我有一个键盘,其 F2、F3、F4 键分别发送ctrl+a
、ctrl+c
、ctrl+v
事件,而不是可以使用 xmodmap 键码映射轻松重新映射的唯一键码。
我的目标是使用键盘的功能键作为功能键而不是媒体键,而不必按键盘的 Fn 修饰符。默认情况下,键盘似乎不支持内置 FN 开关发送 FN 键。
我怎样才能实现这个映射?
查看 xev 日志,这些事件似乎无法区分:
真实ctrl+a
按键:
KeyPress event, serial 33, synthetic NO, window 0x2a00001,
root 0x79a, subw 0x0, time 59266583, (648,900), root:(648,900),
state 0x0, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
XKeysymToKeycode returns keycode: 37
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 36, synthetic NO, window 0x2a00001,
root 0x79a, subw 0x0, time 59266869, (647,899), root:(648,900),
state 0x4, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (01) ""
XmbLookupString gives 1 bytes: (01) ""
XFilterEvent returns: False
KeyRelease event, serial 36, synthetic NO, window 0x2a00001,
root 0x79a, subw 0x0, time 59266989, (647,899), root:(648,900),
state 0x4, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (01) ""
XFilterEvent returns: False
KeyRelease event, serial 36, synthetic NO, window 0x2a00001,
root 0x79a, subw 0x0, time 59266989, (647,899), root:(648,900),
state 0x4, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
XKeysymToKeycode returns keycode: 37
XLookupString gives 0 bytes:
XFilterEvent returns: False
按 F2 键:
KeyPress event, serial 33, synthetic NO, window 0x2a00001,
root 0x79a, subw 0x0, time 59337346, (648,900), root:(648,900),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 33, synthetic NO, window 0x2a00001,
root 0x79a, subw 0x0, time 59337346, (648,900), root:(648,900),
state 0x4, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (01) ""
XmbLookupString gives 1 bytes: (01) ""
XFilterEvent returns: False
KeyRelease event, serial 36, synthetic NO, window 0x2a00001,
root 0x79a, subw 0x0, time 59337451, (648,900), root:(648,900),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 36, synthetic NO, window 0x2a00001,
root 0x79a, subw 0x0, time 59337451, (648,900), root:(648,900),
state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (61) "a"
XFilterEvent returns: False
该键盘的品牌为 EOENKK。
输出bluetoothctl info <device>
:
[Bluetooth Keyboard]# info 15:10:40:4F:00:07
Device 15:10:40:4F:00:07 (public)
Name: Bluetooth Keyboard
Alias: Bluetooth Keyboard
Appearance: 0x03c1
Icon: input-keyboard
Paired: yes
Bonded: yes
Trusted: no
Blocked: no
Connected: yes
WakeAllowed: yes
LegacyPairing: no
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
UUID: Human Interface Device (00001812-0000-1000-8000-00805f9b34fb)
UUID: Unknown (0000ff50-0000-1000-8000-00805f9b34fb)
Modalias: usb:v04E8p7021d0300
ManufacturerData Key: 0x4b51
ManufacturerData Value:
49 45 IE
[Bluetooth Keyboard]#