Create keyboard hooks for Java programs located in the system tray

Basically, I have a java program running in the system tray. If the user presses Ctrl Shift 1, it will select the right-click option of one of the Java programs located in the tray

I think what I'm looking for is a tutorial on doing this, or the simplest way I've never done anything like this before, so maybe it's some kind of Noobie tutorial?

thank you

Solution

Therefore, creating a keyboard hook is not as easy as it seems. For security reasons, Java does not provide a direct way to interact with system events; Because it may cause serious problems about JVM, sysytem memory and portability of Java framework

You have 4 ways to make global keyboard hooks:

1 - learn JNI / JNA. I prefer JNA because it is much easier than JNI. You should deal with both cases DLL file

2 - using jintellitype, as you said - there are some problems

3 - elegance of Sergei biletnikov here @ r_ 419_ 2422 @ case

4 - ignore Java and try to use AutoIT V3 (I'm not 100% sure about it, but I think you can send signals / events from AutoIT to your Java application, so AutoIT is just a bridge to capture global keystrokes)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>