缺少 KeyPress 事件

缺少 KeyPress 事件

我买了新的 ThinkPad,它缺少一把钥匙,但在应该在的地方ContextMenu却有PrintScreen钥匙。ContextMenu我使用 重新映射了它xmodmap

问题是,关键是缺少KeyPress事件,只有KeyRelease事件存在。我发现密钥代码是 107 并运行

xmodmap -e "keycode 107 = Menu NoSymbol Menu"

如果我按ContextMenu...嗯... PrintScreen,则会生成如下所示xev

KeymapNotify event, serial 40, synthetic NO, window 0x0,
keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   8   0   0   
       0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 40, synthetic NO, window 0x4c00001,
root 0xb8, subw 0x0, time 19723366, (753,710), root:(761,752),
state 0x10, keycode 107 (keysym 0xff67, Menu), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

正如您所看到的,KeyPress丢失了,并且KeyRelease在孤独中正确地宣布了“菜单”。它并没有完全损坏:当我按Super+时PrintScreen,它KeyPress神奇地出现了:

KeyPress event, serial 40, synthetic NO, window 0x4c00001,
root 0xb8, subw 0x0, time 19800199, (462,314), root:(470,356),
state 0x10, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x4c00001,
root 0xb8, subw 0x0, time 19800349, (462,314), root:(470,356),
state 0x50, keycode 107 (keysym 0xff67, Menu), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x4c00001,
root 0xb8, subw 0x0, time 19800408, (462,314), root:(470,356),
state 0x50, keycode 107 (keysym 0xff67, Menu), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x4c00001,
root 0xb8, subw 0x0, time 19800541, (462,314), root:(470,356),
state 0x50, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

现在可以使用,但还不够完善。
有人看到我的了吗KeyPress?它去哪儿了?

相关内容