Computer Science Canada Clearing the mouse queue? |
Author: | a_ndy [ Mon Jul 19, 2004 8:13 pm ] |
Post subject: | Clearing the mouse queue? |
I was wondering if there was a way to clear the mouse queue... I know Turing's help index says Mouse.ButtonWait checks if there is an appropriate event (a click) in the queue... however, if I have a section of program where actions are prompted by consecutive mouse clicking and someone does some mad clicking right at the beginning, the program will skip right through all those actions in the blink of an eye because all those clicks are queued up. So then, back to the question... is there a way to clear the queue after each action so that the next action requires a new click instead of just the ones queued up way back when? |
Author: | Tony [ Mon Jul 19, 2004 10:20 pm ] | ||
Post subject: | |||
shouldn't a delay before each check allow the system to process the extra clicks? if not, don't use .ButtonWait. Use .MouseWhere and check for the click yourself rether then having the system wait for one. the flush function would probably look something like
|
Author: | DanShadow [ Mon Jul 26, 2004 6:39 pm ] |
Post subject: | |
Yep, that works. I also used something similar to that when I was helping a friend out on his ISU. He was making checkers, and to judge where he was moving the piece, he had to use a code similar to that, and when he let go of the mouse button (b=0) then it would exit the loop, and place the piece accordingly, if it were in an acceptable place. So basically include the rest of your programs code inside a mini program..ie the one tony showed you. |