Sign in Join
FPDoc Onlineexperiment

TKeyEvent procedure type

In unit Controls

Defines an event handler for key events.

Declaration

pascal
TKeyEvent = procedure(Sender: TObject; var Key: Word; 
 Shift: TShiftState) of object

Arguments

Sender

TObject for the key event.

Key

ScanCode for the key in the event.

Shift

TShiftState modifier for the specified key.

Description

TKeyEvent is an object procedure type which specifies a handler for key events.

TKeyEvent is the type used to implement the OnKeyDown and OnKeyUp event handlers in TWinControl. Applications must implement an object procedure using the signature for the event, and assign it to the event handler to respond to the notification.

See TKeyPressEvent for the handler used to implement OnKeyPress events.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.