我正在尝试了解发生了什么。我正在xev
调试此问题。
对于普通键,例如ESC
, 的输出xev
为:
KeyPress event, serial 37, synthetic NO, window 0x5800001,
root 0x7c0, subw 0x0, time 5520877, (82,81), root:(3374,285),
state 0x10, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) "
mbLookupString gives 1 bytes: (1b) "
FilterEvent returns: False
但是使用 Fn 时结果是:
FocusOut event, serial 37, synthetic NO, window 0x5800001,
mode NotifyGrab, detail NotifyAncestor
FocusOut event, serial 37, synthetic NO, window 0x5800001,
mode NotifyUngrab, detail NotifyPointer
FocusIn event, serial 37, synthetic NO, window 0x5800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 37, synthetic NO, window 0x0,
keys: 4294967232 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
我想使用xkb
文件重新映射键,如所解释的那样这里,但是对于 Fn 该怎么做却并不明显。
答案1
事实证明,密钥已被另一个应用程序捕获,正如所描述的那样这里,即gnome-settings-daemon
。
我安装了sudo apt install dconf-editor
,然后我可以更改密钥的绑定:
/org/gnome/settings-daemon/plugins/media-keys/screen-brightness-down-static
并将其设置为''
。 重启电脑后,该键不再改变我的屏幕亮度,xev
该键的输出为:
KeyPress event, serial 37, synthetic NO, window 0x2400001,
root 0x7c0, subw 0x0, time 27282496, (170,174), root:(3443,1424),
state 0x10, keycode 232 (keysym 0x1008ff03, XF86MonBrightnessDown), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False