Re: how to check mouse/keyboard activity w/o focus?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2004-02-18 at 00:44, gqin@xxxxxxx wrote:
> Hi, I am writing a code that can call a suspend command if there is low
> cpu activity and no mouse or keyboard activity for some time period. I
> wonder if there is a way to check the mouse and keyboard activity if the
> mouse/keyboard is not focussed on this object? Thanks.

Try the following - but note that the check itself will appear as
activity.

stat /dev/mouse
stat `tty`

The "access" time field will show last mouse time. You will need to
experiment with the keyboard - the `tty` given above probably won't cut
it.

Cheers, Ben
-- 
.O.    Ben Stringer
..O    ben@xxxxxxxxxxx
OOO    linux|java|majitek|gnu




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux