Linux 基于xev/evtest绑定自定义按钮
我有一个两边有两个按钮的鼠标 我已经发布了两个按钮的Linux 基于xev/evtest绑定自定义按钮,linux,mouse,x11,xorg,Linux,Mouse,X11,Xorg,我有一个两边有两个按钮的鼠标 我已经发布了两个按钮的xev和evtest输出: xev EnterNotify event, serial 37, synthetic NO, window 0x4600001, root 0x306, subw 0x0, time 5663259, (11,69), root:(799,121), mode NotifyNormal, detail NotifyInferior, same_screen YES, focus YES, state 0 Keym
xev
和evtest
输出:
xev
EnterNotify event, serial 37, synthetic NO, window 0x4600001,
root 0x306, subw 0x0, time 5663259, (11,69), root:(799,121),
mode NotifyNormal, detail NotifyInferior, same_screen YES,
focus YES, state 0
KeymapNotify event, serial 37, synthetic NO, window 0x0,
keys: 6 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
---------------------------------------------------------------------------
---------------------------------------------------------------------------
EnterNotify event, serial 37, synthetic NO, window 0x4600001,
root 0x306, subw 0x4600002, time 5662311, (30,60), root:(818,112),
mode NotifyUngrab, detail NotifyVirtual, same_screen YES,
focus YES, state 0
KeymapNotify event, serial 37, synthetic NO, window 0x0,
keys: 6 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
evtest:
Event: time 1420063746.029705, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1420063746.029705, type 1 (EV_KEY), code 276 (BTN_EXTRA), value 1
Event: time 1420063746.029705, -------------- SYN_REPORT ------------
Event: time 1420063746.165669, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1420063746.165669, type 1 (EV_KEY), code 276 (BTN_EXTRA), value 0
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Event: time 1420063746.165669, -------------- SYN_REPORT ------------
Event: time 1420063747.373693, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1420063747.373693, type 1 (EV_KEY), code 275 (BTN_SIDE), value 1
Event: time 1420063747.373693, -------------- SYN_REPORT ------------
Event: time 1420063747.533689, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1420063747.533689, type 1 (EV_KEY), code 275 (BTN_SIDE), value 0
如何将这些按钮映射到一些虚拟键?例如,如何将这些按钮映射为
后退
和前进
?或者,上下滚动?您是否有任何按钮按下/按钮释放事件?如何获取这些事件?我甚至使用btnx
来检测按钮(有效),并尝试将BTN_4
和BTN_5
用于上下滚动,但没有效果。我正在并行运行imwheel
,但我也测试了在没有imwheel
的情况下运行btnx
,但没有任何效果。我有一个鼠标,上面有这些事件代码。他们扮演着后退/前进的角色。无论如何,这不是一个编程问题,没有代码。没错,但是unix.stackexchange.com的点击率没有这个高,也没有人能回答这个问题,所以我在这里碰碰运气:)