How to detect ctrl-t keypress in Delphi

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.

Answers


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;

Need Your Help

git show old version of file in editor

git

I figured out I can show old versions of a file using 'git log filename' to show the commits, and then use 'git show commit-id:filename' for the old version. But it just puts it in less.

Refused to execute inline event handler because it violates CSP. (SANDBOX)

javascript jquery google-chrome google-chrome-app sandbox

I'm developing a google chrome packaged app, when I put Sandbox in the manifest.json: