>In windows, would removing the messages from the queue be as good?  You
>could do something like
>
>repeat until PeekMessage(MsgStruct, Form1.Handle, WM_KEYFIRST, WM_KEYLAST,
>PM_REMOVE) = 0;
>
>(warning - untried)


I think you need to be more selective about the messages - this
will toss EVERYTHING.    And if something is "happening" that
keeps sending messages this loop never terminates.

One way (also untried) would be to intercept all keyboard events 
with a handler that either tosses the message or passes it to
the inherited handler depending on a flag.   When you want to
flush - you set the flush flag to "toss" then set a timer 
and when the timer pops clear the flag.

Windows will guarantee (I think) that you get events sequenced
in order - so "buffered" keyboard events will all show up before
the first timer tick.      In effect you flush "everthing before
the timer tick".

No idea if this works though ...


ns















---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to