Board index » delphi » Keyboard Events

Keyboard Events

Is there an easy way to intercept a keyboard event at form level and if an
acceptable key is pressed, pass it thro to a chosen component other discard
it?

--
Cheers

Starb

* ----------------------------------------------------------------*
* Lo fa, ne-ko shi-ma de vaja blade Bladerunner *
* ----------------------------------------------------------------*
*        Hey, want a Mac accounts package?        *
*  Then why not visit www.astraaccounts.co.uk  *
*   and download your free copy of Astra now.  *

 

Re:Keyboard Events


Quote
Starb wrote:

> Is there an easy way to intercept a keyboard event at form level

Is the Form's OnKeyDown event unsuitable for your needs?

Re:Keyboard Events


Set KeyPreview to True and use the OnKeyDown or OnKeyPress events of the
form.
Set Key to 0 (or #0) to signal that the key is processed and shouldn't be
passed on to the control with current focus.

"Starb" <st...@ukonline.co.uk> schreef in bericht
news:KRDf6.10501$_B6.58357@monolith.news.easynet.net...

Quote
> Is there an easy way to intercept a keyboard event at form level and if an
> acceptable key is pressed, pass it thro to a chosen component other
discard
> it?

> --
> Cheers

> Starb

> * ----------------------------------------------------------------*
> * Lo fa, ne-ko shi-ma de vaja blade Bladerunner *
> * ----------------------------------------------------------------*
> *        Hey, want a Mac accounts package?        *
> *  Then why not visit www.astraaccounts.co.uk  *
> *   and download your free copy of Astra now.  *

Other Threads