Lazarus
Free Pascal => Unix => Topic started by: jalphonse on January 14, 2015, 10:26:55 am
-
Hi,
I try to program the mouse in a linux console (xterm). Even with the very simple example given in the mouse unit reference, I cannot get it working. When I run the example, it only prints ANSI escape code on the console each time I press a mouse button.
Here is the code used:
Program Example2;
Uses mouse;
begin
InitMouse;
Writeln('Press right mouse button to exit program');
While (GetMouseButtons<>MouseRightButton) do ;
DoneMouse;
end.
Thank you for your help.
-
I try to program the mouse in a linux console (xterm).
The Linux console or the Linux terminal is the tty which you usually access via pressing e.g. [Ctrl] + [Alt] + [F1].
When I run the example, it only prints ANSI escape code on the console each time I press a mouse button. […]
This corresponds to the documented behavior (http://www.freepascal.org/docs-html/rtl/mouse/index.html):
No support for graphical screens is implemented, and there are (currently) no plans to implement this.
Starting your application on the Linux terminal (not under X11 or Wayland) [while gpm is running] results in the expected behavior.