How to make Java JNI KeyListener with C ++

I am trying to make a program like AutoHotKey, but with a graphical interface. I use java.awt.Robot Now I want to make a code for checking the status of a key (in AHK: getKeyState) Of course, something like KeyListener without focus. I already read something with JNI and C ++, but ... I can not find the information.

Can someone help me?

0
java c ++ jni global keylistener
source share
2 answers

There are many good JNI resources for starting JNI programming, such as the Sun JNI Tutorial . Almost all tutorials require a good knowledge of C / C ++, because the Java Native Interface (JNI) is a bridge between native C / C ++ code, the Java virtual machine, and everything running there (which means your Java bytecode).

First, you can find the key capture library for the selected operating system (you did not mention anything specific here) in C ++ and try this, and also check if there are already some Java bindings (libraries that use JNI and offer Java classes) for interaction . Unfortunately, I did not find prospects for a quick search.

+1
source share

Great for 32/64 bit windows. No need to integrate dll files into workspace / deployment process (eclipse). Amazing Lib:

Hot stuff! http://ksquared.de/blog/2011/07/java-global-system-hook/

0
source share

All Articles