Is it possible within Lazarus to tell if the mouse has not moved and no key has been…
Thanks for the prompt Dave - made me start thinking ! TMouse gives all I need -

Mailing lists / lazarus / 2003-04
4 messages · 3 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Is it possible within Lazarus to tell if the mouse has not moved and no key has been…
Thanks for the prompt Dave - made me start thinking ! TMouse gives all I need -
Is it possible within Lazarus to tell if the mouse has not moved and no key has been…
MMMM, depending on what DE you use, there are different approaches here, one would definitely be Xscreensaver, for example you could set it with only kdeinit-shutdown as screensaver, and neatly quit when it activates, or you add a line to kill a session manager etc.
I am not really sure that you will gain anything by programming it yourself though.
That said, if you do want to program this, try using something like SDL_Events, just don't open and SDL screen, and poll the mouse. I cannot guarantee it will work (at all) but it could.
If all else fails, you could always figure out a way to make unix domain sockets run promiscuous, then listen in on the X-server/Client coms :-)
A.J.
Is it possible within Lazarus to tell if the mouse has not moved and no key has been pressed for a period (similar to a screensaver timeout) ?
I need to watch for this for the entire screen / all apps, not just within my Laz app (to initiate a terminal logout)
Thanks
Hi Steve,
Would it be sufficient to let XScreenSaver (or equivalent) do this for you ?
If you need more than that.... I don't know, perhaps there is something in TScreen ?
Cheers
DC