[Lazarus] intercepting keyboard events

Ondrej Pokorny lazarus at kluug.net
Mon May 22 16:19:46 CEST 2017


On 22.05.2017 16:05, Graeme Geldenhuys via Lazarus wrote:
> On 2017-05-22 15:01, Ondrej Pokorny via Lazarus wrote:
>> For an example look how it is done in TCustomDBGrid.MouseDown.
>>
>> + The control can always get focused by the Tab key, if TabStop=True.
>
>
> I'll double check that as well, just to be sure.
> Thanks to both for the very prompt replies. Much appreciated.

I checked again and it seems that Zeljko wrote Qt bindings so that they 
take care of the csNoFocus flag. But no other WidgetSet does so. So 
there probably is an incompatibility between LCL WidgetSets regarding this.

csNoFocus has no effect on plain win32 TWinControl and it's descendants 
that do not handle csNoFocus explicitely (and are not bound to native 
widgets - they are special, see below).

It is also so that some (maybe all) native win32 widgets (edit, button 
etc.) always get focused automatically if they are clicked on with the 
mouse and they are enabled - you cannot have a clickable TButton that 
doesn't receive focus when clicked on but receives focus with TAB key. 
With a custom non-native button it is perfectly possible.

Ondrej


More information about the Lazarus mailing list