WoWInterface (
-   Wish List (
-   -   Key Bind Handlers (

Vrul 09-12-13 03:25 PM

Key Bind Handlers
Wrapping a secure button's OnClick handler is easy enough but there always needs to be extra code to handle the key binds associated with that button. In some cases the overhead involved for processing key binds may actually be greater than the code it is there to support, especially for the primary action bar which its key binds can be redirected to two other action bars.

My suggestion would to be change the key bind handling functions to emulate being clicked rather than directly calling the function normally assigned to their OnClick handlers. So, for example, in ActionButtonDown and ActionButtonUp the line:

SecureActionButton_OnClick(button, "LeftButton")
would instead be:

Such a simple change would always allow a button with a wrapped/hooked OnClick handler to behave the same whether directly clicked or triggered via a key bind with no extra overhead.

SDPhantom 09-12-13 07:15 PM

The idea you proposed is irrelevant to keybinds and is a simplification on running a button's OnClick handler.
At any rate, your proposition already exists exactly as you described it.

See button:Click()

Vrul 09-12-13 07:26 PM

I think you completely missed the point of the suggestion.

Vrul 10-14-13 01:48 PM

If taint is a concern then this should work:

securecall(button.Click, button, "LeftButton");
or for really secure:

if (issecure()) then
    SecureActionButton_OnClick(button, "LeftButton");

But it really is bothersome to wrap an OnClick script and still have to manually deal with keybinds.

All times are GMT -6. The time now is 10:35 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI