Vcl.AppEvnts.TCustomApplicationEvents.OnShortCut

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnShortCut: TShortCutEvent read FOnShortCut write FOnShortCut;

C++

__property Vcl::Forms::TShortCutEvent OnShortCut = {read=FOnShortCut, write=FOnShortCut};

Properties

Type Visibility Source Unit Parent
event protected
Vcl.AppEvnts.pas
Vcl.AppEvnts.hpp
Vcl.AppEvnts TCustomApplicationEvents

Description

Occurs when the user presses a key (before the OnKeyDown event).

Use OnShortCut to dispatch shortcut keystrokes before the form or its controls handle them. When the user presses a key, the application can dispatch it as a shortcut key instead of allowing the standard keystroke processing (OnKeyDown, OnKeyPress, and OnKeyUp). Built-in shortcut processing is provided for menu shortcuts and actions associated with the form. OnShortCut lets the application implement additional shortcuts.

If the OnShortCut event handler responds to the keystroke, set its Handled parameter to true. This prevents the keystroke from being passed on to menus or actions associated with the application. It also prevents the standard keystroke processing in the same way that a menu or action shortcut does.

Note: Call the CancelDispatch method from an OnShortCut event handler to prevent the application from forwarding the event to any other application events objects.

See Also

Code Examples