[Lazarus] Arrow keys casue my control to lose focus

Anthony Walter sysrpl at gmail.com
Fri Mar 6 16:28:58 CET 2015


I am porting some controls for my Cross Codebot library, and one of them is
a generic grid type control. The problem is on Ubuntu with Gtk pressing the
arrows keys causes my grid to lose focus, even though I am
handling WMGetDlgCode.

Here is  brief video of the problem:

https://www.youtube.com/watch?v=COpz4Sia1fY

And the relevent code:

procedure WMGetDlgCode(var Msg: TWMGetDlgCode); message WM_GETDLGCODE;

procedure TContentGrid.WMGetDlgCode(var Msg: TWMGetDlgCode);
begin
  inherited;
  Msg.Result := DLGC_WANTARROWS or DLGC_WANTCHARS or DLGC_WANTALLKEYS;
end;

Yet focus is still lose when my grid is focused and an arrow key is
pressed. Does anyone know how to stop focus from leaving under the
conditions I've outlined?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150306/7902e318/attachment-0002.html>


More information about the Lazarus mailing list