[DUG] TCustomControl's keyboard input

Gajo Csaba csaba at enyem.com
Tue Dec 12 14:06:44 NZDT 2006


Thanks for the help, it finally works! :)

Csaba


On Tue, 12 Dec 2006 01:34:54 +0100, Stacey Verner <stacey at cjntech.co.nz>  
wrote:

> There are things you have to do when setting up a control to allow it to
> accept special keys.
>
> You can handle the WM_GETDLGCODE message and return DLGC_WANTARROWS or
> for more control handle the CM_WANTSPECIALKEY message.
>
> Stacey
>
> -----Original Message-----
> From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
> On Behalf Of Gajo Csaba
> Sent: Tuesday, 12 December 2006 11:56
> To: delphi at ns3.123.co.nz
> Subject: [DUG] TCustomControl's keyboard input
>
> Hello,
>
> I'm writing a custom memo control to display some special symbols. All
> is
> going well and I'm already able to type in any character, as well as
> delete with backspace and del. The only problem that remains are the
> left
> and right buttons which should be used for moving the cursor.
> What happens is that when I press either left or right the component
> loses
> focus. Since this component is the only one on the form, it doesn't have
>
> anything to lose the focus to, but this does happen, since the OnEnter
> and
> OnExit events get executed. When I press left 2 more times the focus
> returns.
> I've made an OnKeyDown method which should handle the left and right
> keys.
> I've checked with the debugger and it never enters this method! When I
> press Enter, for example, then it does enter the method, so it only
> doesn't seem to work with left and right.
>
> Any idea how I should handle this?
>
> Thanks, Csaba
>
> p.s. I'm using Delphi 5.
>
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the Delphi mailing list