Source language: Translate to:

Mouse Functions

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Mouse Functions

Postby Bernardo » Sat Nov 29, 2008 6:08 am

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,
Bernardo
Bernardo
 
Posts: 62
Joined: Mon Nov 06, 2006 2:35 pm

Postby Gaev » Sat Nov 29, 2008 6:54 am

Bernardo:

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"
Else
   SetVar "[clickStatus]" "clicked once"
   TimerStart "TimerForButtonX" "[DoubleClickThreshold]"
Endif


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.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Bernardo » Sat Nov 29, 2008 7:07 am

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,

Bernardo
Bernardo
 
Posts: 62
Joined: Mon Nov 06, 2006 2:35 pm


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests