Sign in to follow this  
PumpkinPieman

Mouse button delays

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this