MrFredo Posted January 31, 2010 Share Posted January 31, 2010 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
robhol Posted January 31, 2010 Share Posted January 31, 2010 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
MrFredo Posted January 31, 2010 Author Share Posted January 31, 2010 Yes it is that I did, I use GetTickCount, I need to assign a different action by a simple click or double click on the button Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now