在 VMware 中安裝 Ubuntu 後,滑鼠中鍵(滾輪點擊/貼上)常失效。原因在於 VMware 的虛擬滑鼠驅動 vmmouse 與 Xorg 預設協定不匹配。透過調整 /etc/X11/xorg.conf 即可修復。
sudo gedit /etc/X11/xorg.conf
InputDevice 區段,修改/新增如下選項:
Section "InputDevice"
Identifier "Configured Mouse"
Driver "vmmouse"
Option "Protocol" "ImPS/2"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "yes"
EndSection
關鍵參數說明:
Protocol "ImPS/2":支援滾輪與中鍵的 PS/2 協定擴展ZAxisMapping "4 5":將滾輪上下對應按鈕 4/5Emulate3Buttons "yes":雙鍵同時按下模擬中鍵Ctrl+Alt+Backspace # 重啟 X Server
# 或
sudo service lightdm restart # Ubuntu 14.04+
sudo systemctl restart display-manager # systemd 系統
瀏覽器中中鍵點擊連結可在新分頁開啟,終端機中鍵貼上選取文字,功能全數恢復正常。
xorg.conf 不存在,可自行建立或執行 sudo X -configure 產生範本Driver "vmmouse" 為正確選擇;未安裝 Tools 可改用 Driver "mouse"一鍵修復滑鼠中鍵,恢復高效瀏覽與終端機操作體驗。