you'll need native code to achieve that, have a read of the following:
http://ochafik.free.fr/blo
Main Topics
Browse All TopicsHello experts!
I actually have an application coded in Delphi that helps me to track the hours my programmers spend in a task. For that I detect the idle time elapsed (how long they don't use the keyboard and/or mouse) and based on that info I summarize only the real hours... no matter what application they are using (it is in my todo's)
Well my problem is that for example I've decided to work with Linux, and also I have many programers working in linux and mac; so I want to create a program in JAVA (because is more crossplatform) that can work in all platforms (catching the idle keyboard and mouse time ).
I have executed my actual application .exe using wine.. but it doesn't work, just catch the keboard and mouse actions in the aplication but not in all the client host.
Thanks
JHL
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
you'll need native code to achieve that, have a read of the following:
http://ochafik.free.fr/blo
Java (or actually the JRE library system) basically is an abstraction of things common to most operating systems. This is why Swing is such a hard thing to get right; there is quite a bit of difference between the systems, so there is a lot of things Swing has to do itself. Low level stuff like mouse movements within the OS won't be part of it. So you will have to have a bridge to the OS and go native. JNA as objects mentions might be something for you.
I really wish I had. Maybe it's better to ask the question as well in a C++ zone as well. That language has got the most low level libraries, maybe there is a library that is the same for all platforms. Otherwise you may have to write a small C++ JNI piece of code for the three platforms using OS calls. A quick Google search would suggest such a thing.
JHL, please notice that you've not posted a real answer to the solution. In that case it is better to ask an admin to close the question. It now seems that you've answered your own question, while the question has not been resolved (and won't be until somewhere in the very far future decides to create platform agnostic Java API's for this functionality).
Business Accounts
Answer for Membership
by: CEHJPosted on 2008-04-21 at 15:46:15ID: 21406799
Now that's a coincidence since someone was asking me a few days ago how he could produce cross-platform keyboard and mouse movements simulating his doing some work.
Seriously though, why would you think Wine would help? That will at most only catch events in the Windows 'vm'. You need to implement keyboard and mouse hooks at the native level for each OS