我正在使用一个名为JNativehook的java库来接收Lubuntu和Windows上的输入事件,我的问题是,当我在Lubuntu上使用阿拉伯语键盘布局键入字符时,我会收到该键的英语邻居,但当我在Windows上使用该库时,我收到的是正确的键,为什么会发生这种情况?我该怎么解决呢?
这是我的代码:
public void nativeKeyTyped(NativeKeyEvent e)
{
System.out.println("char: " + e.getKeyChar());
}
我从这里下载了2.1,但是问题变得更糟了,当我输入一个阿拉伯字符时,我会收到奇怪的字符和很多事件,而这只是输出的一小部分
INFO: hook_event_proc [314]: Key 0 typed. (罟)
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. (ý
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. (罟)
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. ()
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. ()
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. (
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. (
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. (
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. (
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. (ý½
Oct 19, 2016 4:43:27 PM org.jnativehook.GlobalScreen$NativeHookThread enable
INFO: hook_event_proc [314]: Key 0 typed. (罟)
Char:
最佳答案
问题在于如何在Linux上翻译这些代码,我已经更改了backing library,它在2.1中解决了这个问题。