...flush the mouse/keyboard buffer?

Author: P. Below
Homepage: http://www.teamb.com

Category: System

procedure EmptyKeyQueue;
var
  
Msg: TMsg;
begin
  while 
PeekMessage(Msg, 0, WM_KEYFIRST, WM_KEYLAST,
    PM_REMOVE or PM_NOYIELD) do;
end;

procedure EmptyMouseQueue;
var
  
Msg: TMsg;
begin
  while 
PeekMessage(Msg, 0, WM_MOUSEFIRST, WM_MOUSELAST,
    PM_REMOVE or PM_NOYIELD) do;
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base