Recent

Author Topic: [SOLVED] How to prevent Linux to enter Standby while my program is running?  (Read 9616 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 2514
    • StrumPract is the musicians best friend
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/

Code: Pascal  [Select][+][-]
  1. Program Example7;
  2. { Program to demonstrate the SetMouseXY function. }
  3. Uses mouse;
  4. begin
  5.   InitMouse;
  6.   Writeln('Click right mouse button to quit.');
  7.   SetMouseXY(40,12);
  8.   Repeat
  9.     Writeln(GetMouseX,',',GetMouseY);
  10.     If (GetMouseX>70) then
  11.       SetMouseXY(10,GetMouseY);
  12.     If (GetMouseY>20) then
  13.       SetMouseXY(GetMouseX,5);
  14.   Until (GetMouseButtons=MouseRightButton);
  15.   DoneMouse;
  16. end.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs

PascalDragon

  • Hero Member
  • *****
  • Posts: 3518
  • Compiler Developer
What is a console application for you?

A console application is an application of which the standard input and output have console capabilities, be it a command line interpreter on Windows (cmd, PowerShell, etc.) or a TTY/PTY on *nix.

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/

That should probably be reported then.

Fred vS

  • Hero Member
  • *****
  • Posts: 2514
    • StrumPract is the musicians best friend
What is a console application for you?

A console application is an application of which the standard input and output have console capabilities, be it a command line interpreter on Windows (cmd, PowerShell, etc.) or a TTY/PTY on *nix.

Ha, so happy that we think the same!

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/

That should probably be reported then.

Hum...  :-X

Fre;D

I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs

tetrastes

  • Full Member
  • ***
  • Posts: 131
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/
Unit mouse.pp at linux uses gpm, so this demo works fine in character-mode console with gpm, but does not in terminal emulators for X.
But there must be solution for both gpm and X, as we can see at f.e. Midnight Commander.
« Last Edit: October 14, 2021, 12:06:27 am by tetrastes »

 

TinyPortal © 2005-2018