在Windows/Linux/Mac上的Java程序中对全局热键有反应吗? [英] React on global hotkey in a Java program on Windows/Linux/Mac?
本文介绍了在Windows/Linux/Mac上的Java程序中对全局热键有反应吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Java6应用程序位于系统托盘中.需要使用热键(例如,Super-G或Ctrl-Shift-L等)将其激活,然后执行某些操作(例如,显示输入框).
A Java6 application sits in the system tray. It needs to be activated using a hotkey (e.g. Super-G or Ctrl-Shift-L etc) and do something (e.g. showing an input box).
- Windows(XP或Vista)
- OS/X
- Linux(Gnome或KDE)
推荐答案
我已经使用JNA在Java中为全局热键编译了一个库.目前,它支持Windows,Linux和Mac OSX.它还支持Windows和Linux上的媒体密钥.
I've compiled a library for global hotkeys in java using JNA. It currently supports Windows, Linux and Mac OSX. It also supports media keys on windows and linux.
如果有人感兴趣,请尝试 https://github.com/tulskiy/jkeymaster
if anyone is interested, try https://github.com/tulskiy/jkeymaster
任何反馈,我将不胜感激.
I would appreciate any feedback.
谢谢.
这篇关于在Windows/Linux/Mac上的Java程序中对全局热键有反应吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文