Lazarus

Programming => LCL => Topic started by: tomitomy on May 12, 2018, 07:17:39 am

Title: How to disable TMemo's "default shortcuts" in Windows?
Post by: tomitomy on May 12, 2018, 07:17:39 am
Hi, everybody. I have a question, how to disable TMemo's "default shortcut" in Windows, such as Ctrl+Z, Ctlr+Y, I don't need it, it will interfere with normal operation.

I have used custom "popup menu" replaces the system default "popup menu", but when my "Undo" action is disabled, the system will capture Ctrl+Z and perform its own undo process. How can I disable it? Can someone help me?
Title: Re: How to disable TMemo's "default shortcuts" in Windows?
Post by: balazsszekely on May 12, 2018, 07:32:08 am
Like this:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  2. begin
  3.   if (ssCtrl in Shift) and (Key = 90) then //disable Ctrl + Z
  4.   begin
  5.     Key := 0;
  6.     Exit;
  7.   end;
  8. end;
Title: Re: How to disable TMemo's "default shortcuts" in Windows?
Post by: tomitomy on May 12, 2018, 07:44:31 am
Thank you GetMem, your code work very well in my program, I'm very happy! :P
TinyPortal © 2005-2018