appevents OnAppKeyUp event
Example
Return to Introduction  Previous page  Next page
Applies to
acAppEvents component.  

Declaration
type  
  TacAppKeyEvent = procedure(Sender: TObject; var Key: Word; Shift: TShiftState; KeyName: String; RepeatedKeypress: Boolean) of object;  
 
property OnAppKeyUp: TacAppKeyEvent;  

Description
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.  
 
tip The OnAppKeyUp handler can respond to all keyboard keys, including function keys and keys combined with the Shift, Alt, and Ctrl keys.  

Parameters
KeyVirtual key code for pressed key (use VK_xx contants, for example, VK_ESCAPE = 27, VK_F1 = 112 and so forth);  
ShiftStateThe state of control keys like Shift, Ctrl and Alt;  
KeyNameThe name of pressed key;  
RepeatedKeypressIs the the key is down before the evvent occurs is sent. This is keypress is repeated if True.  

Example
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;  

See also
OnAppKeyDown event.