Sign in Join
FPDoc Onlineexperiment

TLCLTaskDialog.KeyDown procedure

Member of TLCLTaskDialogpublicIn unit TaskDlgEmulation

Implements the OnKeyDown event handler for the task dialog.

Declaration

pascal
procedure KeyDown(var Key: Word; Shift: TShiftState); override

Description

KeyDown is an overridden method in TLCLTaskDialog which implements the handler routine for OnKeyDown events in the dialog form. KeyDown ensures that Esc, Alt+F4, and F1 key down events are applied properly for the emulated task dialog.

When BorderIcons indicates that the dialog form can be closed (contains biSystemMenu), the Esc (Escape) key can be used to close the dialog form by calling the Close method. Without the system border icon, the Esc key is not handled in the method.

When Key and Shift indicate that the Alt+F4 key was pressed, the value in Key is digested (set to 0). The native task dialog blocks Alt+F4 to close the dialog, so it is blocked in the emulated task dialog as well.

When Key indicates that F1 was pressed, the DoOnHelp method in the TTaskDialog instance is called to signal an assigned OnHelp event handler in the task dialog. The value in Key is set to 0 to consume the key event.

KeyDown calls the inherited method prior to exit.

See also

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.