將滑鼠中鍵 2 對應到滑鼠左鍵 1

將滑鼠中鍵 2 對應到滑鼠左鍵 1

我正在嘗試將滑鼠中鍵 B2 映射到左鍵 B1。我正在使用 xmodmap,我的理解是指針是用來改變它的。

這是〜/.Xmodmap

pointer = 1 1 3 4 5 6 7 8 9

但我收到這個錯誤。有任何想法嗎?

~$ xmodmap ~/.Xmodmap
Warning: Only changing the first 9 of 20 buttons.
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  116 (X_SetPointerMapping)
  Value in failed request:  0x1
  Serial number of failed request:  9
  Current serial number in output stream:  9

這個 modmap 可以工作,但是按鈕當然是相反的。 〜/.Xmodmap

pointer = 2 1 3 4 5 6 7 8 9

答案1

好吧,沒關係。我使用 xinput 找到了更好的解決方案:

$ xinput list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech Wireless Mouse                   id=10   [slave  pointer  (2)]
⎜   ↳ MyMouse                                   id=11   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=13   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Video Bus                                 id=8    [slave  keyboard (3)]
    ↳ Power Button                              id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]
    ↳ MSI WMI hotkeys                           id=14   [slave  keyboard (3)]
    ↳ Logitech Wireless Mouse                   id=15   [slave  keyboard (3)]
    ↳ BSK30 (AVRCP)                             id=16   [slave  keyboard (3)]

然後取得 id 滑鼠 ID,例如 11(恰好是 Magic Mouse)並映射按鈕。

$ xinput set-button-map 11 1 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

相關內容