![]() Example |
![]() ![]() ![]() |
acAppEvents component.
|
type
|
TacAppKeyEvent = procedure(Sender: TObject; var Key: Word; Shift: TShiftState; KeyName: String; RepeatedKeypress: Boolean) of object;
|
|
property OnAppKeyUp: TacAppKeyEvent;
|
The OnAppKeyUp event occurs after user releases a key that has been pressed in ANY window or control within the application. Use the OnAppKeyDown event to process any keypresses in whole program, even if the focus aimed to the control with different handle, in any form within current application process thread.
|
|
![]() |
Key | Virtual key code for pressed key (use VK_xx contants, for example, VK_ESCAPE = 27, VK_F1 = 112 and so forth);
|
ShiftState | The state of control keys like Shift, Ctrl and Alt;
|
KeyName | The name of pressed key;
|
RepeatedKeypress | Is the the key is down before the evvent occurs is sent. This is keypress is repeated if True.
|
procedure TMainForm.KeyHook1AppKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState; KeyName: string; RepeatedKeypress: Boolean);
|
begin
|
if not RepeatedKeypress then
|
Memo1.Lines.Add('Released: ' + KeyName);
|
end;
|
OnAppKeyDown event.
|