Jump to content
  • Advertisement
Sign in to follow this  
PumpkinPieman

Mouse button delays

This topic is 4703 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would have asked this question on the chat but I can't stay connected. At any rate. I'm trying to figure out decent timeouts for specific button procedures. Like how many milliseconds until a click becomes a hold? Or how many milliseconds between two clicks would classify as a double click? Has anyone found any good times that work? Thanks

Share this post


Link to post
Share on other sites
Advertisement
In general, a double-click has about a half-second delay. Also, often a click becomes a "drag" not in terms of time, but after the mouse is moved while held down more than a pixel or so.

Share this post


Link to post
Share on other sites
There are system parameters with this information:
GetDoubleClickTime() - double click time in milliseconds

GetSystemMetrics:
w/ SM_CXDRAG - maximum horizontal distance mouse can move with moust button down before it is considered a 'drag'
w/ SM_CYDRAG - maximum vertical distance mouse can move with moust button down before it is considered a 'drag'
w/ SM_CXDOUBLECLK - maximum horizontal distance between two clicks that will allow them to be counted as a double click
w/ SM_CYDOUBLECLK - maximum vertical distance between two clicks that will allow them to be counted as a double click

SystemParametersInfo:
w/ SPI_GETMOUSEHOVERTIME - milliseconds before mouse is considered 'hovering'
w/ SPI_GETMOUSEHOVERHEIGHT - maximum vertical distance mouse can move before the movement resets the 'hover timer'
w/ SPI_GETMOUSEHOVERWIDTH - maximum horizontal distance mouse can move before the movement resets the 'hover timer'

There is no such thing as a 'hold' - If you are talking about dragging, it is based on the distance you move the mouse with the button down rather than the amount of time you hold the mouse button down. You might use the hover time as a delay, but that would be nonstandard and unusual, and it would probably confuse users if they try to drag something and it only works if they wait a certain amount of time.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!