Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Detect User Activity in Mac OS X from SWT/RCP(I need to detect user activity/inactivity from a SWT/RCP app on Mac os X)
Detect User Activity in Mac OS X from SWT/RCP [message #715221] Fri, 12 August 2011 19:51 Go to next message
Herman Lintvelt is currently offline Herman Lintvelt
Messages: 2
Registered: July 2009
Junior Member
I want to create a time/task-tracking type application (a planned opensource project) using either SWT or Eclipse RCP, and need to determine the best route to take to detect user activity/inactivity on the different native platforms, starting with Mac OS X.

Worst case one probably have to go the JNI and native code per platform route, but I would like to find out if there is a easier route, perhaps some existing libs our there or some support for this in SWT that I have not discovered yet.

I basically would like to keep track of when a user is actively using the computer, and when not so the timers could be paused/resumed.

Any help would be appreciated.
Re: Detect User Activity in Mac OS X from SWT/RCP [message #715796 is a reply to message #715221] Mon, 15 August 2011 15:00 Go to previous messageGo to next message
Grant Gayed is currently offline Grant Gayed
Messages: 2151
Registered: July 2009
Senior Member
SWT sends UI events while your app has focus. If you want to be made
aware of UI events (or their absence) while a non-SWT app has focus then
you'll need some OS-specific code, as SWT doesn't provide
platform-common API that would enable this.

There was a previous request for this with some discussion at
https://bugs.eclipse.org/bugs/show_bug.cgi?id=37061 .

Grant


On 8/12/2011 3:51 PM, Herman Lintvelt wrote:
> I want to create a time/task-tracking type application (a planned
> opensource project) using either SWT or Eclipse RCP, and need to
> determine the best route to take to detect user activity/inactivity on
> the different native platforms, starting with Mac OS X.
>
> Worst case one probably have to go the JNI and native code per platform
> route, but I would like to find out if there is a easier route, perhaps
> some existing libs our there or some support for this in SWT that I have
> not discovered yet.
>
> I basically would like to keep track of when a user is actively using
> the computer, and when not so the timers could be paused/resumed.
> Any help would be appreciated.
Re: Detect User Activity in Mac OS X from SWT/RCP [message #715849 is a reply to message #715796] Mon, 15 August 2011 18:28 Go to previous message
Herman Lintvelt is currently offline Herman Lintvelt
Messages: 2
Registered: July 2009
Junior Member
Thanks Grant, I expected your answer, just wanted to confirm.

So the way forward seems to be some native code and then using JNI to interact with it. Perhaps I could extend it a bit on the SWT native-to-java level.
Now just to find the time to do this...

Previous Topic:Open internal browser programatically
Next Topic:License File
Goto Forum:
  


Current Time: Wed Oct 22 05:04:55 GMT 2014

Powered by FUDForum. Page generated in 0.03553 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software