[Lazarus] intercepting keyboard events
zeljko
zeljko at holobit.net
Mon May 8 18:46:37 CEST 2017
On 08.05.2017 17:42, Michael Van Canneyt via Lazarus wrote:
>
> Hi,
>
> How can I respond to keyboard events in a TCustomControl (and hence
> TWinControl) descendent ?
>
> I have asigned the various OnKey* events handlers but they are not called.
>
> My control also does not seem to receive focus when clicked, I assume
> this is why
> it doesn't get keyboard events either ?
Yep
>
> Is there something that must be called/set when creating the control to
> make
> it receive focus ?
Just to be sure that control actually can take focus put this
ControlStyle := ControlStyle - [csNoFocus];
into constructor of your control.
z.
More information about the Lazarus
mailing list