Thread Tools Display Modes
Prev Previous Post   Next Post Next
Unread 09-12-13, 03:25 PM   #1
Vrul
A Cobalt Mageweaver
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 202
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:
Code:
SecureActionButton_OnClick(button, "LeftButton")
would instead be:
Code:
button:Click("LeftButton")
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.
Vrul is offline   Reply With Quote
 

Go BackWoWInterface » Developer Discussions » Wish List » Key Bind Handlers

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off