TWinControl.OnKeyDown property
Event handler signalled for key down keyboard events.
Declaration
property OnKeyDown: TKeyEvent read FOnKeyDown write FOnKeyDown;Description
OnKeyDown is a
TKeyEvent property with the event
handler signalled to handle a key down event for the control. The event
handler receives keys including control and other non-visual keys. It is
signalled (when assigned) from the KeyDown method.
The Sender argument contains the control for the key event. It
must be cast to TControl or TwinControl type to access properties or methods
specific to the descendent classes.
The Key argument contains the virtual keyboard constant for the
key event (like VK_F1 or VK_NUMPAD5). It is a variable argument and can be
modified in the event handler. Set Key to VK_UNKNOWN if the handler routine
has performed the actions needed to handle the key event. Otherwise, Key is
passed to other OnKeyDown handlers at the form or application level.
Shift is a set type which contains the modifiers for the key down
event like: Ctrl, Shift, Alt, or Meta.
Use OnKeyUp to perform actions needed when the key is released.
Use OnKeyPress or OnUTF8KeyPress to implement a handler routine for printable character values.
- https://docs.kde.org/stable5/en/khelpcenter/fundamentals/kbd.html
- https://help.gnome.org/users/gnome-help/stable/shell-keyboard-shortcuts.html.en
- https://developer.gnome.org/hig/reference/keyboard.html
- https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec
- https://support.apple.com/en-us/102650
- https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts#Comparison_of_keyboard_shortcuts
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
