我有一个Logitech MX400无线设备。它有一个我想用于粘贴的搜索按钮(而不是极其敏感但很难按下的滚轮)。我已经用xbindkeys重新映射了其他按钮,并使用xev查找按钮按下代码,但这不适用于搜索按钮。使用xev并单击搜索按钮,我得到以下事件
FocusOut event, serial 34, synthetic NO, window 0x3c00001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 34, synthetic NO, window 0x3c00001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 34, synthetic NO, window 0x0,
keys: 4294967275 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
PropertyNotify event, serial 34, synthetic NO, window 0x3c00001,
atom 0x1d7 (_NET_WM_ICON_GEOMETRY), time 23653064, state PropertyNewValue
没有ButtonPress事件。似乎在X事件以下的某个级别拦截了搜索按钮。有任何想法吗?我有Ubuntu 12.04。Ubuntu实际上看到了单击并生成了一个搜索对话框,但是在xev中没有单击事件的痕迹。
编辑
我检查了xmodmap提供的方法。我的.Xmodmap
现在包含以下行
keycode 225 = XF86Paste NoSymbol XF86Paste``
xmodmap ~/.Xmodmap
现在运行,将完全禁用该按钮(或者至少,按此按钮不会得到任何结果)。我试过了xmodmap -pke
,它打印出来了:
keycode 225 = XF86Paste NoSymbol XF86Paste NoSymbol XF86Paste
够奇怪的 所有其他条目的格式类似。我已经接近解决方案,但是仍然有些奇怪。
编辑2
我尝试运行xinput(从未听说过此命令。令人惊讶的东西)。Logitech有两个条目。这是列出每个列表的输出(标识9和10)
Logitech USB Receiver id=9 [slave pointer (2)]
Reporting 7 classes:
Class originated from: 9. Type: XIButtonClass
Buttons supported: 24
Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button Side" "Button Extra" "Button Forward" "Button Back" "Button Task" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown"
Button state:
Class originated from: 9. Type: XIValuatorClass
Detail for Valuator 0:
Label: Rel X
Range: -1.000000 - -1.000000
Resolution: 1 units/m
Mode: relative
Class originated from: 9. Type: XIValuatorClass
Detail for Valuator 1:
Label: Rel Y
Range: -1.000000 - -1.000000
Resolution: 1 units/m
Mode: relative
Class originated from: 9. Type: XIValuatorClass
Detail for Valuator 2:
Label: Rel Horiz Wheel
Range: -1.000000 - -1.000000
Resolution: 1 units/m
Mode: relative
Class originated from: 9. Type: XIValuatorClass
Detail for Valuator 3:
Label: Rel Vert Wheel
Range: -1.000000 - -1.000000
Resolution: 1 units/m
Mode: relative
Class originated from: 9. Type: XIScrollClass
Scroll info for Valuator 2
type: 2 (horizontal)
increment: 1.000000
flags: 0x0
Class originated from: 9. Type: XIScrollClass
Scroll info for Valuator 3
type: 1 (vertical)
increment: -1.000000
flags: 0x2 ( preferred )
Logitech USB Receiver id=10 [slave pointer (2)]
Reporting 6 classes:
Class originated from: 10. Type: XIButtonClass
Buttons supported: 7
Button labels: "Button 0" "Button Unknown" "Button Unknown" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right"
Button state:
Class originated from: 10. Type: XIKeyClass
Keycodes supported: 248
Class originated from: 10. Type: XIValuatorClass
Detail for Valuator 0:
Label: Rel X
Range: -1.000000 - -1.000000
Resolution: 1 units/m
Mode: relative
Class originated from: 10. Type: XIValuatorClass
Detail for Valuator 1:
Label: Rel Y
Range: -1.000000 - -1.000000
Resolution: 1 units/m
Mode: relative
Class originated from: 10. Type: XIValuatorClass
Detail for Valuator 2:
Label: Rel Horiz Wheel
Range: -1.000000 - -1.000000
Resolution: 1 units/m
Mode: relative
Class originated from: 10. Type: XIScrollClass
Scroll info for Valuator 2
type: 2 (horizontal)
increment: 1.000000
flags: 0x0
测试设备9对该按钮不执行任何操作。相反,测试设备10可以工作,这是我单击时的输出
$ xinput test 10
key press 225
key release 225
key press 225
key release 225
key press 225
key release 225
因此,在这方面,鼠标似乎充当了键盘,但是由于某种原因,xmodmap在接收键225时不执行任何操作。
**编辑**
我可以确认每次单击按钮都会添加keycode 225 = a
打印a
。因此,问题似乎与XF86Paste的实际处理方式有关。我正在发送它,但没有粘贴。
tail -f /var/log/dmesg
然后尝试按按钮。您是否获得任何有关按键/按钮的输出?
xinput list
然后使用找出您的搜索键的按钮代码xinput test <MOUSE ID>
。这样行吗?
xbindkeys
准备好在启动时运行吗?您可以禁用它,然后再试一次吗?