![如何重新映射触发多个事件的键?](https://linux22.com/image/953501/%E5%A6%82%E4%BD%95%E9%87%8D%E6%96%B0%E6%98%A0%E5%B0%84%E8%A7%A6%E5%8F%91%E5%A4%9A%E4%B8%AA%E4%BA%8B%E4%BB%B6%E7%9A%84%E9%94%AE%EF%BC%9F.png)
我最近买了一个小型折叠键盘,上面有一个 .com 键(我从来没用过),但没有我经常使用的 del(ete) 键。使用 xev 我发现按下 .com 会触发一系列事件:
KeyPress event, serial 28, synthetic NO, window 0x2200001,
root 0x1c3, subw 0x0, time 6648508, (126,-8), root:(1360,270),
state 0x0, keycode 60 (keysym 0x2e, period), same_screen YES,
XLookupString gives 1 bytes: (2e) "."
XmbLookupString gives 1 bytes: (2e) "."
XFilterEvent returns: False
KeyRelease event, serial 28, synthetic NO, window 0x2200001,
root 0x1c3, subw 0x0, time 6648510, (126,-8), root:(1360,270),
state 0x0, keycode 60 (keysym 0x2e, period), same_screen YES,
XLookupString gives 1 bytes: (2e) "."
XFilterEvent returns: False
KeyPress event, serial 28, synthetic NO, window 0x2200001,
root 0x1c3, subw 0x0, time 6648510, (126,-8), root:(1360,270),
state 0x0, keycode 54 (keysym 0x63, c), same_screen YES,
XLookupString gives 1 bytes: (63) "c"
XmbLookupString gives 1 bytes: (63) "c"
XFilterEvent returns: False
KeyRelease event, serial 28, synthetic NO, window 0x2200001,
root 0x1c3, subw 0x0, time 6648522, (126,-8), root:(1360,270),
state 0x0, keycode 54 (keysym 0x63, c), same_screen YES,
XLookupString gives 1 bytes: (63) "c"
XFilterEvent returns: False
KeyPress event, serial 28, synthetic NO, window 0x2200001,
root 0x1c3, subw 0x0, time 6648522, (126,-8), root:(1360,270),
state 0x0, keycode 32 (keysym 0x6f, o), same_screen YES,
XLookupString gives 1 bytes: (6f) "o"
XmbLookupString gives 1 bytes: (6f) "o"
XFilterEvent returns: False
KeyRelease event, serial 28, synthetic NO, window 0x2200001,
root 0x1c3, subw 0x0, time 6648546, (126,-8), root:(1360,270),
state 0x0, keycode 32 (keysym 0x6f, o), same_screen YES,
XLookupString gives 1 bytes: (6f) "o"
XFilterEvent returns: False
KeyPress event, serial 28, synthetic NO, window 0x2200001,
root 0x1c3, subw 0x0, time 6648546, (126,-8), root:(1360,270),
state 0x0, keycode 58 (keysym 0x6d, m), same_screen YES,
XLookupString gives 1 bytes: (6d) "m"
XmbLookupString gives 1 bytes: (6d) "m"
XFilterEvent returns: False
KeyRelease event, serial 28, synthetic NO, window 0x2200001,
root 0x1c3, subw 0x0, time 6648547, (126,-8), root:(1360,270),
state 0x0, keycode 58 (keysym 0x6d, m), same_screen YES,
XLookupString gives 1 bytes: (6d) "m"
XFilterEvent returns: False
当然,我无法将键码 60(或此处的任何其他键码)重新映射到 del,因为我需要 . 和 c。我在这里能做什么?