如何在Java中使用JIntellitype? 如果那是不可能的,我将如何在系统托盘菜单上使用热键,即使应用程序不在焦点上也会起作用。
但是,我无法让JIntellitype在MAC OSX上工作。
如何在mac上完成这项工作?
How is it possible to use JIntellitype in Java? If that's not possible, how would I use Hotkey on a system tray menu, which would act even if application is not in focus.
However, I have not been able to get JIntellitype to work on MAC OSX.
How can I make this work on a mac?
最满意答案
我知道这个问题有点陈旧,但没有答案。 JIntellitype使用Java Native Interface(JNI)来利用直接与操作系统API对话的C / C ++,从而绕过JVM的沙箱限制。 正如您已经注意到的,本机C / C ++代码依赖于平台,在这种情况下只能在Windows上运行。 Linux( JxGrabKey )和Mac OSX( OSSupport )也有类似的项目,但每个平台的API都不同。 如果您需要更好的跨平台支持,可以尝试使用JNativeHook 。
I know this question is a bit old, but it has no answer. JIntellitype uses that Java Native Interface (JNI) to leverage C/C++ that talks to the operating system's API directly thus bypassing the sandbox limitations of the JVM. As you have already noticed, the native C/C++ code is platform dependent and will only run on Windows in this case. There are similar projects for Linux (JxGrabKey) and Mac OSX (OSSupport), however, the API for each platform differs. If you need better cross platform support, you can try using JNativeHook.
更多推荐
发布评论