WoWInterface - View Single Post - Key Bind Handlers
View Single Post
09-12-13, 03:25 PM   #1
An Onyxian Warder
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 397
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.
  Reply With Quote