Skip to main content

TdxBarManager.OnHandleKey Event

Enables you to handle a keystroke or prevent the bar manager from handling it.

Declaration

property OnHandleKey: TdxBarHandleKeyEvent read; write;

Remarks

The Sender parameter specifies the bar manager.

The AKey and AShift parameters specify a keystroke – the pressed key and the state of the Alt, Ctrl, and Shift keys.

The AHandled parameter specifies if the following mechanism is used to handle the keystroke after the OnHandleKey event handler’s execution:

  • The bar manager searches for an element (a bar item or its link) whose shortcut or accelerator key corresponds to this keystroke and if found, activates this element. To prohibit the bar manager from performing this search, call the IgnoreKeyStroke procedure in the event handler;

  • If no element is found, the bar manager searches for another bar manager in a hierarchy of parent forms/frames, and if found, delegates keystroke handling to it by firing its OnHandleKey event. The search starts with the parent of the bar manager’s form/frame, then its parent, and so on;

  • If no bar manager handles the keystroke, passes it to application event handlers, etc.

You can implement a response to the keystroke and pass True as the AHandled parameter to override this mechanism.

Note

The OnHandleKey event handler does not fire for bar items that are assigned an action.

See Also