Mouse button dblclick ?
by Billy L · in Torque Game Engine · 04/23/2003 (11:45 pm) · 5 replies
Hi all !
Maybe this is a easy one !
But how do i bind a mousebutton dblclick ?
-Billy
Maybe this is a easy one !
But how do i bind a mousebutton dblclick ?
-Billy
#3
Also, it may already be in there, but missing the constant you need to bind something to it. Search for any of the other mouse constants in the source and see what you can dig up.
04/24/2003 (10:31 am)
A less hacked and more efficient way of doing it would be to move what Pat Wilson first said into the mouse handling code then make a bind for doubleclick for use with the scripted bind() function.Also, it may already be in there, but missing the constant you need to bind something to it. Search for any of the other mouse constants in the source and see what you can dig up.
#4
When it's processing your clicks, it determines the time between clicks, if it's below some threshold value it adds your click to the mouseClickCount.
So, just use this, search for it in the engine and you'll see it is used.
04/24/2003 (11:25 am)
It already handles this, take a look at guiTypes.h the GuiEvent has a member variable named mouseClickCount.When it's processing your clicks, it determines the time between clicks, if it's below some threshold value it adds your click to the mouseClickCount.
So, just use this, search for it in the engine and you'll see it is used.
#5
what i want is a dblclick when i play the game like Pats idea !
But if could find the function in the source would be better .
04/24/2003 (11:43 am)
Jared is the guiTypes.h an ingame function ?what i want is a dblclick when i play the game like Pats idea !
But if could find the function in the source would be better .
Torque 3D Owner Pat Wilson
onClick if currentTime - lastCallTime < deltaClickTime fireDoubleClickFunction else fireClickFunction lastCallTime = currentTime endNot sure if there is a way to get current MS via script, if not you'll have to work around it like so (really a hack, I'm sure there is a better way to do this)function clickTimerReset() { $clickCount = 0; } function mouseClickHandler() { $clickCount++; if( $clickCount > 1 ) { handleDoubleClick(); } else { handleSingleClick(); } schedule( deltaClickTime, clickTimerReset ); // Syntax correct? I forget now. }Hope that helps, again I don't have my computer at the moment so I'm a bit iffy on the syntax and such, but you get the idea.