Handling OS level events?

I want to handle os level events in java. I need to do to execute some logic when a key is pressed. I find jni is used for this purpose, but don't know how to do it. I do not need to handle events on gui. my application will run in the background and execute some logic with every keystroke.

+1
source share
1 answer

If you think that using the GUI is excessive, I would not use JNI, which will be 10 times more complicated. Even if you are confident in C, it can be difficult.

You better use a library that does what you want, like http://jline.sourceforge.net/

0
source

Source: https://habr.com/ru/post/1436927/


All Articles