我想用键盘wheel up
和wheel down
。
Pointer_Button1,Pointer_Button2和Pointer_Button3在xmodmap上正常工作。 但是Pointer_Button4和Pointer_Button5并不起作用。
.Xmodmap
的一部分在下面。
pointer = 1 2 3 4 5
keycode 10 = 1 exclam Pointer_Button1
keycode 11 = 2 at Pointer_Button2
keycode 12 = 3 numbersign Pointer_Button3
keycode 13 = 4 dollar Pointer_Button4
keycode 14 = 5 percent Pointer_Button5
和
Mode_switch
+ 1
,点击鼠标上的left button
即可正常使用。Mode_switch
+ 2
,点击鼠标上的middle button
即可正常使用。Mode_switch
+ 3
,点击鼠标上的right button
即可正常使用。但是
Mode_switch
+ 4
,鼠标wheel up
无法正常工作。Mode_switch
+ 5
,鼠标wheel down
无法正常工作。环境:
centos$ cat /etc/centos-release
CentOS release 6.9 (Final)
ubuntu$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
我使用XForwarding 从Centos(X服务器和X客户端)到ssh上的Ubuntu(X客户端)。
GNOME(2.28.2)在Centos上运行,keymap在Ubuntu上加载。
加载keymap:
ubuntu$ xmodmap ~/.Xmodmap
ubuntu$ xkbset m
这里我显示xev输出
Mode_switch
。1
。2
。3
。4
。5
。Mode_switch
。left button
middle button
right button
wheel up
鼠标wheel down
鼠标ubuntu$xev
KeyPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056786138, (114,87), root:(116,144),
state 0x0, keycode 134 (keysym 0xff7e, Mode_switch), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
PropertyNotify event, serial 38, synthetic NO, window 0x4400001,
atom 0x18f (XKLAVIER_STATE), time 2056786139, state PropertyNewValue
PropertyNotify event, serial 38, synthetic NO, window 0x4400001,
atom 0x18f (XKLAVIER_STATE), time 2056786140, state PropertyNewValue
ButtonPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056796258, (114,87), root:(116,144),
state 0x2000, button 1, same_screen YES
ButtonRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056796362, (114,87), root:(116,144),
state 0x2100, button 1, same_screen YES
ButtonPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056796882, (114,87), root:(116,144),
state 0x2000, button 2, same_screen YES
ButtonRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056797034, (114,87), root:(116,144),
state 0x2200, button 2, same_screen YES
ButtonPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056797338, (114,87), root:(116,144),
state 0x2000, button 3, same_screen YES
ButtonRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056797450, (114,87), root:(116,144),
state 0x2400, button 3, same_screen YES
KeyPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056797746, (114,87), root:(116,144),
state 0x2000, keycode 13 (keysym 0xfeec, Pointer_Button4), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056797842, (114,87), root:(116,144),
state 0x2000, keycode 13 (keysym 0xfeec, Pointer_Button4), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056798810, (114,87), root:(116,144),
state 0x2000, keycode 14 (keysym 0xfeed, Pointer_Button5), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056798874, (114,87), root:(116,144),
state 0x2000, keycode 14 (keysym 0xfeed, Pointer_Button5), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056800250, (114,87), root:(116,144),
state 0x2000, keycode 134 (keysym 0xff7e, Mode_switch), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
PropertyNotify event, serial 38, synthetic NO, window 0x4400001,
atom 0x18f (XKLAVIER_STATE), time 2056800251, state PropertyNewValue
PropertyNotify event, serial 38, synthetic NO, window 0x4400001,
atom 0x18f (XKLAVIER_STATE), time 2056800252, state PropertyNewValue
ButtonPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056802997, (114,87), root:(116,144),
state 0x0, button 1, same_screen YES
ButtonRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056803173, (114,87), root:(116,144),
state 0x100, button 1, same_screen YES
ButtonPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056803901, (114,87), root:(116,144),
state 0x0, button 2, same_screen YES
ButtonRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056804077, (114,87), root:(116,144),
state 0x200, button 2, same_screen YES
ButtonPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056804501, (114,87), root:(116,144),
state 0x0, button 3, same_screen YES
ButtonRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056804693, (114,87), root:(116,144),
state 0x400, button 3, same_screen YES
ButtonPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056805949, (114,87), root:(116,144),
/ state 0x0, button 4, same_screen YES
ButtonRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056805949, (114,87), root:(116,144),
state 0x800, button 4, same_screen YES
ButtonPress event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056806909, (114,87), root:(116,144),
state 0x0, button 5, same_screen YES
ButtonRelease event, serial 38, synthetic NO, window 0x4400001,
root 0xa9, subw 0x0, time 2056806909, (114,87), root:(116,144),
state 0x1000, button 5, same_screen YES
在键盘上按Mode_switch
+ 1
,Mode_switch
+ 2
和Mode_switch
+ 3
会被识别为button1
, button2
和button3
,但Mode_switch
+ 4
和Mode_switch
+ 5
为Pointer_Button4
和Pointer_Button5
。< / p>
ubuntu$ xmodmap -pp
There are 10 pointer buttons defined.
Physical Button
Button Code
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
当然,鼠标wheel up
和wheel down
也能正常使用。