OS level event handling?

你离开我真会死。 提交于 2020-01-16 19:46:28

问题


I want to handle os level events in java. I need to do is to perform some logic on key press. I find jni is used for this purpose but don't know how. I don't need to handle event on gui. my application will run on background and perform some logic on every key press.


回答1:


If you think using a GUI is overkill, I wouldn't consider using JNI which will be 10x harder. Even if you are confident in C, it can be tricky.

You are better off using a library which does what you want already like http://jline.sourceforge.net/



来源:https://stackoverflow.com/questions/12615714/os-level-event-handling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!