Vcl.Controls.TWinControl.DoKeyDown
Delphi
function DoKeyDown(var Message: TWMKey): Boolean;
C++
bool __fastcall DoKeyDown(Winapi::Messages::TWMKey &Message);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | protected | Vcl.Controls.pas Vcl.Controls.hpp |
Vcl.Controls | TWinControl |
Description
Performs some preprocessing before generating an OnKeyDown event.
The return value from DoKeyDown determines if the control should continue processing key-down messages passed in the Message parameter. A return value of true indicates that the key-down occurrence has been handled completely, and no further processing is needed. A return value of false indicates that the application should continue passing the key-down message through the inherited processing.
DoKeyDown checks whether the KeyPreview property of the parent form is true; if so, it allows the form to preemptively process key-down messages before they are handled by the windowed control. If the form does not handle the message, DoKeyDown translates the message parameters into the appropriate types and calls KeyDown, which in turn calls the OnKeyDown event handler, if any.