Widget handlers < OnDoubleClick

Description Edit

The OnDoubleClick handler is called when a UI element is double-clicked with the mouse.

Arguments Edit

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 Edit

  • 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
    if this.timer == time() and this.startTimer then
        this.startTimer = false

        this.startTimer = true
        this.timer = time()

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.