I just spend quite a long time finding a way to securely mimic the console variable ActionButtonUseKeyDown, so that custom action bars (beyond the default UI range) can securely respond on key-press (down) and mouse-release (up).
A lot of solutions that I tried simply didn't work. Mouse and keybuttons both up: easy. Mouse and keybuttons both down: easy. For the default action bar ranges: easy. But for actions beyond the multi-action-bar range? Lots of things I tried wouldn't work.
I think I've found a solution, and just want to post it here for three reasons:
(a) Can anyone think of a way this is going to fail?
(b) Am I overthinking it... is there an easier way to do this?
(c) If not, maybe someone else will find this useful?
-- create a typical action button... but also inherit SecureHandlerBaseTemplate
local button = CreateFrame("CheckButton", "myActionButton80", nil, "SecureActionButtonTemplate,SecureHandlerBaseTemplate")
-- give it a keybinding, and make it respond to mouse clicks