Re: How to mesure the inactivity time

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

 



Adel ESSAFI wrote:
> Hi list
> 
> 
> I am developping a tool with java and I want to know the inactivity time
> of the user, i.e, the duration of the time that the keybord and mouse
> were not used.

Use a static variable (secondsSincePress) in your main class (e.g.
MyProgram), add a keyPressed method (along with blank methods for the
rest of the KeyListener interface) that sets secondsSincePress to 0,
then call MainJFrame.addKeyListener from MyProgram's main.  It is
basically the same thing for mouse (MouseListener), except I don't think
there's any way to detect mouse /movements/ (only presses and entering
and leaving the window).

Let us know if you still have questions.

Matt Flaschen

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

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

  Powered by Linux