Jump to content

onClientGUIDoubleClick not works for button


MrFredo

Recommended Posts

Hello,

The event onClientGUIDoubleClick does not work on a button

This script works:

addEventHandler("onClientResourceStart", _localPlayer,
function ()
local window = guiCreateWindow(0.4,0.4,0.1,0.1,"test",true)
addEventHandler("onClientGUIDoubleClick",window,doubleClickTest,false)
showCursor(true)
end
)
function doubleClickTest(button,state)
outputDebugString(tostring(button).."|"..tostring(state))
end

This script not works:

addEventHandler("onClientResourceStart", _localPlayer,
function ()
local button = guiCreateButton(0.4,0.4,0.1,0.1,"test",true)
addEventHandler("onClientGUIDoubleClick",button,doubleClickTest,false)
showCursor(true)
end
)
function doubleClickTest(button,state)
outputDebugString(tostring(button).."|"..tostring(state))
end

Is this normal?

Link to comment

Yes, I think so.

First; why do you even need to double click a button? Doesn't make much sense.

Second; if you -have- a good reason to do it, you can use getTickCount to check the time between clicks. If the interval is short enough, it was a double click.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...