The compiler would not accept: TRichMemo(Sender).Lines.Add('Left');
I had to change it to: TempRTF.Lines.Add('Left'); // where is TempRTF: TRichMemo;
Please note that the TRichMemo(Sender).Lines.Add only works in the TRichMemo.OnMouseDown
because there the Sender is a TRichMemo.
For the TForm.OnMouseDown you do need to use RichMemo1.Lines.Add directory with the form variable.
If the TRichMemo(Sender) doesn't work in TRichMemo.OnMouseDown then there is something seriously wrong with your installation.
With that change it fired on the LEFT, MIDDLE, and RIGHT buttons.
But it would not fire on the Extra1 and Extra 2 buttons.
So what happened if you use extra1 and extra2 on an empty part of the Form1?
That's what the tForm.OnMouseDown was for. To test if it works for just the Form in Lazarus.
If it doesn't then there must be something wrong with your mousedriver or you press something else than the extra1 and 2 button.
I am operating on Lazarus IDE v2.0.10r63526,
but I also tried out v3.0 with the latest RichMemo,
and it behaved the same way.
I also use Windows 11.
I used Windows 10 and Ubuntu 22.
But I just tried it in Windows 11 in Hyper-V and there it also just works.
I'm on Lazarus 3.99 (trunk) but that shouldn't mater unless they added something for the mouse later on.
Let me try on Laz3.0....Yep... works fine there too on both the TForm and TRichMemo. So it must be something on your end.