Better Logic In AdvancedGadgetEvents

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Better Logic In AdvancedGadgetEvents

Post by fsw »

You all know the AdvancedGadgetEvents(#TRUE) command.
If you use it you will be able to use the following events:

#PB_EventType_RightClick : right mouse button click
#PB_EventType_LeftDoubleClick : Left mouse button double click
#PB_EventType_RightDoubleClick: Right mouse button double click

in addition to the normal:

#PB_EventType_LeftClick : Left mouse button click

So far so good.

But if you switch AdvancedGadgetEvents on, you get at once more events than you need.

Example:
if you do a Left-MouseButton-DoubleClick you get the following events:
#PB_EventType_LeftClick and later on #PB_EventType_LeftDoubleClick.

And IMHO this is wrong :!:

IMHO ( IF AdvancedGadgetEvents(#TRUE) ) the Event-Handler of PureBasic should look for the Mouse-DoubleClick-Time { you can get it with GetDoubleClickTime_() } then wait this time, and after that fire ONE EVENT:
#PB_EventType_LeftClick OR #PB_EventType_LeftDoubleClick.

BUT NEVER 2 EVENTS FOR ONE INTENDED ACTION :!:

Maybe it's a good idea to add a flag to the AdvancedGadgetEvents command like:

AdvancedGadgetEvents(#TRUE,#WAITDOUBLECLICK)

and users that don't use #PB_EventType_LeftClick AND #PB_EventType_LeftDoubleClick ( or #PB_EventType_RightClick AND #PB_EventType_RightDoubleClick ) at the same time and don't like to waste any milliseconds could type:

AdvancedGadgetEvents(#TRUE)

as it is now.

Best Regards
Franco

I am to provide the public with beneficial shocks.
Alfred Hitshock