Anyone know how to clear the buffer of pending mouse events in a graphics window?
I'm finding GRAPHIC WINDOW CLICK very useful for making an easy graphics console, but incautious mouse clicks can result in the program getting ahead of itself.
Code structure is something like...
DO
GRAPHIC WINDOW CLICK hWin TO clickval,x,y
IF clickval THEN
... various actions based on location of x,y in the graphics window
END IF
clickval=0
GRAPHIC INPUT FLUSH
SLEEP 100
LOOP
The GRAPHIC INPUT FLUSH statement appears to clear keyboard events, but not mouse clicks, so extra clicking whilst executing statements within the IF block causes an immediate jump back into the block as soon as those statements are done. Presumably this is because the click event is stored, so that even after clickval is reset to zero, it immediately becomes TRUE again on the next cycle of the loop.
Any (easy!?) way to solve this?
Any help much appreciated...
I'm finding GRAPHIC WINDOW CLICK very useful for making an easy graphics console, but incautious mouse clicks can result in the program getting ahead of itself.
Code structure is something like...
DO
GRAPHIC WINDOW CLICK hWin TO clickval,x,y
IF clickval THEN
... various actions based on location of x,y in the graphics window
END IF
clickval=0
GRAPHIC INPUT FLUSH
SLEEP 100
LOOP
The GRAPHIC INPUT FLUSH statement appears to clear keyboard events, but not mouse clicks, so extra clicking whilst executing statements within the IF block causes an immediate jump back into the block as soon as those statements are done. Presumably this is because the click event is stored, so that even after clickval is reset to zero, it immediately becomes TRUE again on the next cycle of the loop.
Any (easy!?) way to solve this?
Any help much appreciated...

Comment