问题描述
我有一个罗技 R400 演示器,它有四个按钮:左、右、演示和屏幕。它连接到USB。开箱即用的左/右工作并映射到 Page-Up/Page-Down。 Present 和 Screen 似乎完全开箱即用。我想让后两者也能工作。
这是一个有效的密钥的 xev 示例:
KeyPress event,serial 38,synthetic NO,window 0x6200001,root 0x6c1,subw 0x0,time 308338317,(149,168),root:(154,330),state 0x10,keycode 117 (keysym 0xff56,Next),same_screen YES,XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
两个“死”键不会产生任何 xev 事件。但是,他们确实会发送扫描码:
# evtest
Event: time 1625754445.915648,-------------- SYN_REPORT ------------
Event: time 1625754446.211650,type 4 (EV_MSC),code 4 (MSC_SCAN),value 7004e
Event: time 1625754446.211650,type 1 (EV_KEY),code 109 (KEY_PAGEDOWN),value 1
Event: time 1625754446.211650,-------------- SYN_REPORT ------------
^[[6~Event: time 1625754446.339648,value 7004e
Event: time 1625754446.339648,value 0
Event: time 1625754446.339648,-------------- SYN_REPORT ------------
Event: time 1625754450.523662,value 70029
Event: time 1625754450.523662,code 425 (KEY_PRESENTATION),value 1
Event: time 1625754450.523662,-------------- SYN_REPORT ------------
Event: time 1625754450.667660,value 70029
Event: time 1625754450.667660,value 0
Event: time 1625754450.667660,-------------- SYN_REPORT ------------
Event: time 1625754451.027658,value 70037
Event: time 1625754451.027658,code 431 (KEY_disPLAYTOGGLE),value 1
Event: time 1625754451.027658,-------------- SYN_REPORT ------------
Event: time 1625754451.195657,value 70037
Event: time 1625754451.195657,value 0
Event: time 1625754451.195657,-------------- SYN_REPORT ------------
在这里,我先按了“右”,然后是“演示”,然后是“显示切换”。所有三个按钮都显示完美。
这是指针设备的 xinput 配置:
$ xinput list-props 12
Device 'Logitech USB Receiver Keyboard':
Device Enabled (163): 1
Coordinate Transformation Matrix (165): 1.000000,0.000000,1.000000,1.000000
libinput Send Events Modes Available (286): 1,0
libinput Send Events Mode Enabled (287): 0,0
libinput Send Events Mode Enabled Default (288): 0,0
Device Node (289): "/dev/input/event3"
Device Product ID (290): 1133,50477
我试图将“libinput Send Events Mode Enabled”设置为“1,0”,但这只会破坏所有按钮(然后不再起作用)。
这是我的 xkbmap 配置:
$ setxkbmap -print -query
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwertz)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+de+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};
rules: evdev
model: pc105
layout: de
如何让两个附加按钮生成 X 事件,以便将它们映射到操作或将它们重新映射到不同的键?
请注意,这个问题相当古老,我早在 2018 年就发现了描述该确切问题的帖子,但到目前为止还没有解决方案(例如,https://bbs.archlinux.org/viewtopic.php?id=218693)。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)