Page 1 of 1

Mouse Functions

PostPosted: Sat Nov 29, 2008 6:08 am
by Bernardo
Is it possible to have double click or mouse scroll functions as a tab (actions) like "left click", "mouse enter", etc?

At least for the left double click. I think it would be very useful.
All the best,

PostPosted: Sat Nov 29, 2008 6:54 am
by Gaev

You can develop your own double click functionality for a Button (or Picture) object ... with the help of a [clickStatus] variable and a Timer Object.

In the Left Click section of the Button/Picture object ...
Code: Select all
If "[clickStatus]" "=" "clicked once"
   TimerStop "TimerForButtonX"
   SetVar "[clickStatus]" ""
   GoSub "DoubleClickResponseForButtonX"
   SetVar "[clickStatus]" "clicked once"
   TimerStart "TimerForButtonX" "[DoubleClickThreshold]"

For the Timer Interval section ...
Code: Select all
SetVar "[clickStatus]" ""
GoSub " "LeftClickResponseForButtonX"

a) Set [DoubleClickThreshold] to whatever value you think constitutes a Double Click (vs. two single clicks) ... play around with values between 150 and 250 (milliseconds).

b) Make sure the Timer Object's property is set to "Stop timer after one execution"

c) So, first time you click on an object, the Timer gets started ... if you click again before the Timer Interval has passed, the Double Click actions are serviced ... if the Timer Interval expires before another click, the Left Click actions are serviced.

d) If you want to have Double Clicks for a number of Buttons/Pictures, you can enhance the code to just use one Timer Object for all of them.

PostPosted: Sat Nov 29, 2008 7:07 am
by Bernardo
Thanks for the help, Gaev. As usual very useful info.

Yes, I would like to use it in different buttons/images. It would be cool if it was a tab like the single click in NB.

All the best,