* * *

Author Topic: How to disable TMemo's "default shortcuts" in Windows?  (Read 581 times)

tomitomy

  • Full Member
  • ***
  • Posts: 223
How to disable TMemo's "default shortcuts" in Windows?
« 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?

GetMem

  • Hero Member
  • *****
  • Posts: 3160
Re: How to disable TMemo's "default shortcuts" in Windows?
« Reply #1 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;

tomitomy

  • Full Member
  • ***
  • Posts: 223
Re: How to disable TMemo's "default shortcuts" in Windows?
« Reply #2 on: May 12, 2018, 07:44:31 am »
Thank you GetMem, your code work very well in my program, I'm very happy! :P

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus