Board index » delphi » How do I flush the keyboard input buffer?

How do I flush the keyboard input buffer?

All I need is to simply flush out the keyboard buffer, but I can't seem
to find the function or anything dealing with it?
Can anybody help.

Mitchell Blue

 

Re:How do I flush the keyboard input buffer?


Quote
Mitchell Blue <mtb...@harding.edu> wrote:
>All I need is to simply flush out the keyboard buffer, but I can't seem
>to find the function or anything dealing with it?
>Can anybody help.

This is Windows...you can't flush the keyboard.  Your program gets input from a
message queque, not the hardware and Windows handles the hardware without your
involvement--why do you need to flush the keyboard?

Nate

 Foolproof systems always underestimate
 the ingenuity of a fool.

 Clipper Functions 4.0 for Delphi
 http://members.aol.com/clipfunc

Re:How do I flush the keyboard input buffer?


Look up PeekMessage in the help file. Maybe that will help.

In article <1998050714125300.KAA02...@ladder03.news.aol.com>,
ntr...@aol.com says...

Quote
:Mitchell Blue <mtb...@harding.edu> wrote:

:
:>All I need is to simply flush out the keyboard buffer, but I can't seem
:>to find the function or anything dealing with it?
:>Can anybody help.
:
:This is Windows...you can't flush the keyboard.  Your program gets input from a
:message queque, not the hardware and Windows handles the hardware without your
:involvement--why do you need to flush the keyboard?
:
:
:Nate

Re:How do I flush the keyboard input buffer?


Hi,

Use this code to flush the keyboard buffer .in the past , it was not
easy for me to know it.

procedure clearkbrdbuf;
var
  keybuf_head:byte absolute $0040:$001A;
  keybuf_tail:byte absolute $0040:$001C;
begin
  keybuf_head:=$1E;
  keybuf_tail:=$1E;
end;

Regards,
Hossam
http://www.geocities.com/CapeCanaveral/8790/h_rady.html

Other Threads