[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TCustomForm.OnShortcut

Event handler signalled when a key is pressed, before further handling of the key.

## Declaration

Source position: forms.pp line 808

`public property TCustomForm.OnShortcut : TShortCutEvent read FOnShortcut write FOnShortcut;`

## Description

OnShortcut is a TShortcutEvent property that represents the event handler signalled (when assigned) to detect and handle a shortcut key for the form instance. OnShortcut is called from the IsShortcut method used to examine keystroke events intercepted and forwarded by the Application.

The Msg argument contains the key event examined in the handler. Handled indicates that the key is handled by the event when set to True.

## See also

TCustomForm.IsShortCut |  | Determines whether the specified message contains a shortcut or accelerator key.
TApplication.IsShortCut |  | Checks whether a handler is available for the shortcut key in the message.
TApplication.OnShortCut |  | Event handler signalled to determine if a keystroke message is a shortcut key in the application.
TShortCutEvent |  | Type used for an OnShortcut event handler.