tags:

views:

61

answers:

1

Hi, I am trying to find a way how to write a "software sensor" in Java, running on Mac OS X (10.5), which records each application focus change.

My first idea was to write a "pull sensor" that uses an Applescript, which just returns the name of the app. that is in focus. Obviously this approach is not very good.

Therefore, I was wondering if there is the possibility to get a callback or some kind of notification directly from the operating system, whenever another application gets into the focus.

Thanks in advance! Cheers Julian

+1  A: 

java recieves no events from other applications, so there would be nothing to intercept and record. im sure OSX's SDK has something you could use though. it wouldn't be java based (unless you used JNI or JNA).

aepurniet