From RAD Studio API Documentation
Jump to: navigation, search


property OnKeyDown: TKeyEvent read FOnKeyDown write FOnKeyDown;


__property Fmx::Types::TKeyEvent OnKeyDown = {read=FOnKeyDown, write=FOnKeyDown};


Type Visibility Source Unit Parent
event public
FMX.Controls TControl


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.

See Also