我想将Fn-映射F1到 MacBookPro 11,5 上的命令执行。问题是,目前Fn-F1未被检测为任何键。我不知道如何将它们绑定到 (XF86MonBrightnessDown) 和 (XF86MonBrightnessUp)
我试过我的键盘上的某些键(多媒体键?)无法通过 xev 或 xbindkeys 或 keytouch 检测到:如何检测它们?但安装后,xev 仍然无法检测到Fn-F1和Fn- F2。
我跟着https://help.ubuntu.com/community/AppleKeyboard设置Fn-F12键,使其像在普通笔记本电脑中一样工作。此步骤使Fn-键F1无法F1被检测到。
Add following line to /etc/modeprob.d/hid_apple.conf:
options hid_apple fnmode=2
Run the following command:
sudo update-initramfs -u -k all
Fn我找到了-F1和Fn-的扫描代码F2
- Alt使用--切换到控制台Ctrl。F1
- 显示键-s
- 按下并释放Fn-F1并Fn- F2. 记录扫描码
结果:
Fn-F1 pressed
0xe0 0x4c
Fn-F1 released
0xe0 0xcc
Fn-F2 pressed
0xe0 0x54
Fn-F2 released
0xe0 0xd4
setkeycodes 无法将任何扫描码绑定到键码
Cannot bind numlock to key_A:
$ setkeycodes 45 30
setkeycodes: failed to set scancode 45 to keycode 30: ioctl KDSETKEYCODE: Invalid argument
输出xmodmap -pk
232 0x1008ff03 (XF86MonBrightnessDown) 0x0000 (NoSymbol) 0x1008ff03 (XF86MonBrightnessDown)
233 0x1008ff02 (XF86MonBrightnessUp) 0x0000 (NoSymbol) 0x1008ff02 (XF86MonBrightnessUp)
xev 无法区分Fn-F1和Fn-F2
[Fn-F2 pressed with mouse out of window]
FocusIn event, serial 48, synthetic NO, window 0x2800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 48, synthetic NO, window 0x0,
keys: 4294967206 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
[Fn-F2 pressed with mouse in window]
FocusIn event, serial 48, synthetic NO, window 0x2800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 48, synthetic NO, window 0x0,
keys: 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 0
[Fn-F1 pressed with mouse in window]
FocusIn event, serial 48, synthetic NO, window 0x2800001,
mode NotifyGrab, detail NotifyPointer
KeymapNotify event, serial 48, synthetic NO, window 0x0,
keys: 4294967206 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 1 0 0
[Fn-F1 pressed with mouse out of window]
FocusIn event, serial 48, synthetic NO, window 0x2800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 48, synthetic NO, window 0x0,
keys: 2 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
[Fn-F1 released]
FocusOut event, serial 48, synthetic NO, window 0x2800001,
mode NotifyUngrab, detail NotifyPointer
[F1 key pressed and release]
KeyPress event, serial 48, synthetic NO, window 0x2800001,
root 0x4a6, subw 0x0, time 2628754, (87,17), root:(88,43),
state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 48, synthetic NO, window 0x2800001,
root 0x4a6, subw 0x0, time 2628906, (87,17), root:(88,43),
state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False