Mouse button delays
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
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement