T
toton
Hi,
Is it possible to hook a native event to java, so that it can be
treated uniformly with other events.
Like I want a tablet event (which is fired by a wacom tablet) to come
to a component , and overriding event method for component, I will
catch it, and process according to my requirement. (Though tablet is
mapped to os input device like mouse, that is NOT what I want. Wacom
sends more like the high resolution coordinate value, a proximity
value, pressure value, eraser / airbrush mode etc).
Similarly I want to hook a few other non-gui events in appropriate
place , like my laptop sends a low battery event in the os event
queue, which I need to capture in my Application class.
At present only thing I can do is run a separate thread (preferably
Timer ) and catch the native events there.
But I really interested to hook them in the java EventQueue , so that
they can be handled in uniform way just like the others (say mouse,
mouse wheel, keyboard etc) , and I can re-implement the event and make
a method like processTabletEvent etc.
Apache Harmony project gives some info at
http://harmony.apache.org/subcomponents/classlibrary/awt.html#Event_Handling
but unsure how to do it in Sun's implementation (with the help of JNI
& some public api).
Also it is not clear to me from this topic
http://www.ibm.com/developerworks/java/library/j-jniobs/
Any help is appreciated
Thanks
abir
Is it possible to hook a native event to java, so that it can be
treated uniformly with other events.
Like I want a tablet event (which is fired by a wacom tablet) to come
to a component , and overriding event method for component, I will
catch it, and process according to my requirement. (Though tablet is
mapped to os input device like mouse, that is NOT what I want. Wacom
sends more like the high resolution coordinate value, a proximity
value, pressure value, eraser / airbrush mode etc).
Similarly I want to hook a few other non-gui events in appropriate
place , like my laptop sends a low battery event in the os event
queue, which I need to capture in my Application class.
At present only thing I can do is run a separate thread (preferably
Timer ) and catch the native events there.
But I really interested to hook them in the java EventQueue , so that
they can be handled in uniform way just like the others (say mouse,
mouse wheel, keyboard etc) , and I can re-implement the event and make
a method like processTabletEvent etc.
Apache Harmony project gives some info at
http://harmony.apache.org/subcomponents/classlibrary/awt.html#Event_Handling
but unsure how to do it in Sun's implementation (with the help of JNI
& some public api).
Also it is not clear to me from this topic
http://www.ibm.com/developerworks/java/library/j-jniobs/
Any help is appreciated
Thanks
abir