Board index » delphi » How to intercept keyboard input to tMemo?

How to intercept keyboard input to tMemo?

I want to intercept some keyboard input to a tMemo (so that the tMemo
doesn't process the characters). I tried OnKeyDown, but apparently at
that point the tMemo already has received the character.

-Ted

 

Re:How to intercept keyboard input to tMemo?


Setting the tMemo readOnly property to true inhibits keyboard input but
still allows writing data to the tMemo. In my situation, I can now use
the tMemo's OnKeyDown handler.

-Ted

Quote
Ted Michon wrote:
> I want to intercept some keyboard input to a tMemo (so that the tMemo
> doesn't process the characters). I tried OnKeyDown, but apparently at
> that point the tMemo already has received the character.

> -Ted

Re:How to intercept keyboard input to tMemo?


Quote
In article <3798AE56.A5B8B...@home.com>, Ted Michon wrote:
> I want to intercept some keyboard input to a tMemo (so that the tMemo
> doesn't process the characters). I tried OnKeyDown, but apparently at
> that point the tMemo already has received the character.

Use OnKeyPress, not OnKeyDown, if you want to handle *characters*
(including control characters like backspace or enter), use OnKeyDown
for other keys like arrows, function keys.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:How to intercept keyboard input to tMemo?


How does OnKeyPress prevent characters from going into the tMemo (if I
don't want them to)?

-Ted

Quote
"Peter Below (TeamB)" wrote:
> In article <3798AE56.A5B8B...@home.com>, Ted Michon wrote:
> > I want to intercept some keyboard input to a tMemo (so that the tMemo
> > doesn't process the characters). I tried OnKeyDown, but apparently at
> > that point the tMemo already has received the character.

> Use OnKeyPress, not OnKeyDown, if you want to handle *characters*
> (including control characters like backspace or enter), use OnKeyDown
> for other keys like arrows, function keys.

> Peter Below (TeamB)  100113.1...@compuserve.com)
> No e-mail responses, please, unless explicitly requested!

Re:How to intercept keyboard input to tMemo?


In article <379A1423.D82C0...@home.com>, Ted Michon stated:

Quote
> How does OnKeyPress prevent characters from going into the tMemo (if I
> don't want them to)?

 Key := #0:
--
Regards
Ralph (TeamB)
--

Other Threads