【问题标题】:xmodmap KeyPress Event to ButtonPress eventxmodmap KeyPress 事件到 ButtonPress 事件
【发布时间】:2012-11-28 02:34:21
【问题描述】:

我已经在 unix.stackexchange 上问过这个问题,但到目前为止还没有运气,所以我把它贴在这里。希望有人知道答案。

我刚得到一个罗技 t400 鼠标,一切正常,除了我想将鼠标中键的“顶部”部分重新映射到实际的鼠标中键功能。

当我运行 xev 并捕获点击时,所有鼠标按钮都会返回 ButtonPress/ButtonRelease 事件,但中间按钮的顶部会返回 KeyPress/KeyRelease 事件:

KeyPress event, serial 35, synthetic NO, window 0x5200001,
root 0x31d, subw 0x0, time 630089839, (80,128), root:(2871,588),
state 0x10, keycode 133 (keysym 0x31d, (no name)), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x5200001,
root 0x31d, subw 0x0, time 630089983, (80,128), root:(2871,588),
state 0x50, keycode 133 (keysym 0x31d, (no name)), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

中间按钮的底部工作正常,并返回:

ButtonPress event, serial 37, synthetic NO, window 0x5200001,
root 0x31d, subw 0x0, time 630137726, (10,171), root:(2801,631),
state 0x10, button 2, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x5200001,
root 0x31d, subw 0x0, time 630138960, (10,171), root:(2801,631),
state 0x210, button 2, same_screen YES

我希望重新映射顶部与底部相同,这可以通过 xmodmap 实现吗?

谢谢!

【问题讨论】:

    标签: linux configuration mouse xorg xmodmap


    【解决方案1】:

    下载并构建http://linuxgazette.net/153/misc/ziemann/xevent.c

    编辑 ~/.xbindkeysrc:

    ~ % cat .xbindkeysrc
     "xevent -b 2"
      c:133
    

    将 xbindkeys 添加到您的 ~/.xinitrc

    【讨论】:

    • 这到底是做什么的?
    猜你喜欢
    • 1970-01-01
    • 2010-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-08
    • 1970-01-01
    相关资源
    最近更新 更多