I have a Win32 form with a TEdit control. When the user presses CTRL-t while the TEdit control is in focus, I want to detect it using the OnKeyUp event. I need a code example, please, using the Key and/or Shift variables. Thanks.
Asked
Active
Viewed 3.3k times
1 Answers
25
Set KeyPreview of the form to True, then write this code for OnKeyUp event of your form:
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if (Key = 84) and (Shift = [ssCtrl]) then
ShowMessage('Ctrl+t is pressed!');
end;

vcldeveloper
- 7,399
- 2
- 33
- 39
-
Yes, I found that 30 seconds before you posted and it works. Thanks! – kenalacom Jun 08 '10 at 19:47