WoW:UIHANDLER OnDoubleClick: Difference between revisions
Jump to navigation
Jump to search
(Updating with 2.0 (required in 3.0) variable names) |
m (Move page script moved page UIHANDLER OnDoubleClick to WoW:UIHANDLER OnDoubleClick without leaving a redirect) |
(No difference)
| |
Latest revision as of 04:49, 15 August 2023
← Widget handlers < OnDoubleClick
Description
The OnDoubleClick handler is called when a UI element is double-clicked with the mouse.
Arguments
self - the button frame being clicked
button - a string representing the button that was clicked. Can be any of the following:
- LeftButton
- RightButton
- MiddleButton
- Button4
- Button5
According to how the UI element is setup with API_Button_RegisterForClicks
Notes
- Only Button type frames have an OnDoubleClick script, but you can fake it like this:
-- Known issue. Since, time() returns an integer (not a floating point number),
-- the threshold for double-clicking ranges from 0.0000000000001 to 1 second.
-- I tried using GetTime(), but I couldn't seem to get it to work.
frame.timer = 0
frame:SetScript("OnMouseUp", function(...)
if this.timer < time() then
this.startTimer = false
end
if this.timer == time() and this.startTimer then
this.startTimer = false
DoStuff()
else
this.startTimer = true
this.timer = time()
end
end)