Oh man, drop down menus!
I don't know if we could detect both a single click AND a double click for the same spot (in the same screen state), the single click would always win I would think, though I think Windows does it.
We could mouse down on a spot and release mouse at another spot far enough away to call that a double click or otherwise mouse release at very near the same spot and call that a single click as would be expected. That way we don't have to count clicks we just distinguish how far away the mouse is when released.
Another consideration, use a right click instead of a double left click?
Ah trying to distinguish double click AND single from same spot might be possible, I have an experiment in mind... ;-)
I’ve got a few mouse demos which cover single/double clicks, hover events, drag events, and all, on one of these various forums. If I can find some free time here later, I’ll try and drag one up for you guys.
The trick is in using a timer and counter with the mouse. Basically:
FUNCTION mouseclick
STATIC lastclicktime AS _FLOAT, oldmouse AS INTEGER
WHILE _MOUSEINPUT: WEND
IF lastclicktime = 0 THEN ‘there was no previous click event to deal with
IF oldmouse = UP AND _MOUSEINPUT(1) = DOWN THEN lastclicktime = TIMER ‘start the timer
ELSE ‘we had a previous click event
IF lastclicktime + 0.2 > TIMER THEN
lastclicktime = 0 ‘reset timer
mouseclick = 1 ‘single click if there’s no double click in 0.2 seconds
ELSE
IF oldmouse = UP AND _MOUSEINPUT(1) = DOWN THEN
mouseclick = 2 ‘doubleclick
lastclicktimer = 0
END IF
END IF
oldmouse = _MOUSEINPUT(1)
EXIT FUNCTION