FMX.Controls.TControl.OnKeyDown
Delphi
property OnKeyDown: TKeyEvent read FOnKeyDown write FOnKeyDown;
C++
__property Fmx::Types::TKeyEvent OnKeyDown = {read=FOnKeyDown, write=FOnKeyDown};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | public | FMX.Controls.pas FMX.Controls.hpp |
FMX.Controls | TControl |
Description
Occurs when a key is pressed while the control has focus.
OnKeyDown is called from KeyDown methods of GUI components, for example, of controls and forms.
Write an event handler for OnKeyDown to specify what happens when a control or a form has the input focus and a key is pressed.
Warning: When using a virtual (on-screen) keyboard on Android devices, do not rely on KeyEvents to detect pressed keys, especially text characters. However, KeyEvents detects keys such as
return
and enter
but it does not delete
, depending on the target application. Be aware that other software input methods may never send KeyEvents regardless of the version.