I saw later somewhere in the documentation of unit 'Mouse' that this unit uses text coordinates and works only in programs or consoles in text mode. Maybe this is the reason. Or a not existing / not appropriate mouse driver.
Unit Mouse is for console applications. GUI related convenience units are either part of Lazarus or provided by third parties.
Hello.
What is a console application for you?
The demo given in fpc doc seems to be a console application but does not work here on Debian 11:
https://www.freepascal.org/~michael/docs-demo/docskimmer/mouse/setmousexy/Program Example7;
{ Program to demonstrate the SetMouseXY function. }
Uses mouse;
begin
InitMouse;
Writeln('Click right mouse button to quit.');
SetMouseXY(40,12);
Repeat
Writeln(GetMouseX,',',GetMouseY);
If (GetMouseX>70) then
SetMouseXY(10,GetMouseY);
If (GetMouseY>20) then
SetMouseXY(GetMouseX,5);
Until (GetMouseButtons=MouseRightButton);
DoneMouse;
end.