虽然Pointer_Button1,2,3工作,但xmodmap上的Pointer_Button4,5并不起作用

时间:2018-02-28 08:32:01

标签: linux shell keyboard x11 xmodmap

我想用键盘wheel upwheel 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输出

  1. 按键盘上的Mode_switch
  2. 在键盘上输入1
  3. 在键盘上输入2
  4. 在键盘上输入3
  5. 在键盘上输入4
  6. 在键盘上输入5
  7. 在键盘上发布Mode_switch
  8. 点击鼠标上的left button
  9. 点击鼠标上的middle button
  10. 点击鼠标上的right button
  11. wheel up鼠标
  12. wheel down鼠标
  13. 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 + 1Mode_switch + 2Mode_switch + 3会被识别为button1button2button3,但Mode_switch + 4Mode_switch + 5Pointer_Button4Pointer_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 upwheel down也能正常使用。

0 个答案:

没有答案