Recent

Author Topic: TRichMemo: Popup menu not shown when the Menu key is pressed  (Read 210 times)

CM630

  • Hero Member
  • *****
  • Posts: 1249
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
TRichMemo: Popup menu not shown when the Menu key is pressed
« on: January 23, 2025, 09:57:53 am »
Windows 10, 64 bit, Lazarus 4RC2, 32 bit.
I create a TRichMemo, then I add a popup and link the popup with the RichMemo.
When I right click the memo or I press “Shift + F10” the popup menu is shown.
When I press the menu key on the keyboard the popup menu is not shown, some small rectangle is shown on the place of the mouse instead.

I succeeded in making a workaround, which works:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.RichMemo1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  2. begin
  3.   if (Key = 93) then
  4.   begin
  5.     PopupMenu1.PopUp; //or maybe better TRichMemo(Sender).PopupMenu.PopUp;  
  6.     key := 0;
  7.   end;
  8. end;
So probably the Menu key invokes something which probably should not be invoked.
« Last Edit: January 23, 2025, 10:04:46 am by CM630 »
Лазар 4,0RC2 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018