我拥有一个Razer Naga 鼠标,基本上它的侧面有一个小数字键盘。我想将这些键重新映射到不同的未使用键或 bash 命令。我可以通过使用 xev 获取键码(例如鼠标上的“1”是键码 87)轻松做到这一点,然后我可以使用 xmodmap 将键码绑定到不同的键。
然而,我键盘上的小键盘也会继承这一点,因为键码是相同的,但我注意到“序列”是不同的。
例如,这是在我的鼠标小键盘上按下“1”按钮时 xev 的输出。
KeyPress event, serial 34, synthetic NO, window 0x1c00001,
root 0x1ae, subw 0x0, time 2179878, (170,-2), root:(198,345),
state 0x0, keycode 87 (keysym 0xff9c, KP_End), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 35, synthetic NO, window 0x1c00001,
root 0x1ae, subw 0x0, time 2179966, (170,-2), root:(198,345),
state 0x0, keycode 87 (keysym 0xff9c, KP_End), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
这是在我的键盘小键盘上按“1”时的输出
KeyPress event, serial 35, synthetic NO, window 0x1c00001,
root 0x1ae, subw 0x0, time 2180261, (170,-2), root:(198,345),
state 0x0, keycode 87 (keysym 0xff9c, KP_End), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 36, synthetic NO, window 0x1c00001,
root 0x1ae, subw 0x0, time 2180341, (170,-2), root:(198,345),
state 0x0, keycode 87 (keysym 0xff9c, KP_End), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
无论如何我可以根据这个映射鼠标上的键吗?