寻找在Java的多媒体键的键code [英] Finding keycode of multimedia key in java
问题描述
我要捕获Windows键presses像FN +暂停,FN + VolumeUp在我的Java应用程序,但我无法检测他们的关键codeS。
I want to capture key presses on Windows like Fn+Pause, Fn+VolumeUp in my Java Application but I am unable to detect their KeyCodes.
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
System.out.println(e.getKeyCode());
}
});
使用此片段为所有多媒体键presses打印0!
Using this snippet it prints 0 for all the Multimedia Key Presses !
请提出一个合适的方法寻找关键code,从而利用它的Java应用程序。
Kindly suggest a suitable method for finding the keyCode and thereby utilizing it in Java Application.
推荐答案
使用的的 JIntellitype 的库。
这API是使用C ++ DLL做的Windows所有通信一个Java JNI库。
这也意味着在其上运行的必须是Windows平台。
This API is a Java JNI library that uses a C++ DLL to do all the communication with Windows. That also means the platform on which you are running must be Windows.
如果你是在Linux中使用的 JXGrabKey 的
If you are in Linux use JXGrabKey
在MacOSX上使用的 OSSupport 的
In MacOSX use OSSupport
这篇关于寻找在Java的多媒体键的键code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!