Board index » delphi » Preventing Annoying Beep in OnKeyDown Event

Preventing Annoying Beep in OnKeyDown Event

Does anyone know how to prevent the annoying beep from occuring when the
program executes an onkeydown event ie. Alt L
Any help would be appreciated.

David Lee

 

Re:Preventing Annoying Beep in OnKeyDown Event


Dont know exactly what you are doing, but you can catch the keyevent do
your stuff and then set the Key to #0.

Hope this helps.

In article <508h85$...@news.mel.aone.net.au>, From
d...@acslink.aone.net.au (David Lee), the following was written:

Quote
> Does anyone know how to prevent the annoying beep from occuring when
> the program executes an onkeydown event ie. Alt L
> Any help would be appreciated.

--
Fred Schetterer 73303.3...@compuserve.com
09/02/96 13:55
---------
Using: OUI TE 1.5 from http://www.dvorak.com

Re:Preventing Annoying Beep in OnKeyDown Event


Quote
David Lee wrote:

> Does anyone know how to prevent the annoying beep from occuring when the
> program executes an onkeydown event ie. Alt L
> Any help would be appreciated.

> David Lee

Sure!  In your OnKeyPress event handler, set the "var Key" parameter
to NULL.  Like so...

  Key := #0;

This informs Delphi that the Key has been handled...kind of.  Better
yet, it's like faking Delphi into thinking that no Key has been
pressed -- essentially, the default event handlers down the line recieve
#0, which bypasses that annoying beep.

Hope this helps,
- Jim Rofkar.

Other Threads