當前位置: 首頁>>技術問答>>正文


配置Thinkpad的TrackPoint的最佳方法是什麽?

, , , , ,

問題描述

之前有用的ThinkWiki pages看起來已經過時了。我正在嘗試永久更改我的TrackPoint靈敏度和速度設置,並啟用鼠標中鍵滾動。我過去曾嘗試過configure-trackpoint,但設置沒有永久保存(重啟後會丟失)。

我試過gpointing-device-settings。使用它,我可以讓鼠標中鍵滾動工作,但我無法更改跟蹤點的速度或靈敏度設置。我嘗試過的ThinkWiki頁麵上的所有方法都不能按照Ubuntu 11.04的指示工作。有人可以解釋如何永久編輯TrackPoint設置,以便我可以正確使用它嗎?

最佳解決方案

不幸的是,似乎沒有簡單的方法。我將描述如何創建一個新的Upstart作業,以通過/sys下的虛擬文件係統設置引導時的值。

  1. 找到跟蹤點的設備路徑

    在gnome-terminal中運行以下命令(按Alt + F2,鍵入gnome-terminal,然後按Enter):

    find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/input\/input[0-9]*\/name$//'
    

    在我的情況下,這將返回/sys/devices/platform/i8042/serio1/serio2 – 在以下步驟中更改為它返回的任何內容。

  2. 查找靈敏度和速度的值

    在gnome-terminal中運行以下命令:

    echo 220 | sudo tee /sys/devices/platform/i8042/serio1/serio2/sensitivity
    

    靈敏度為220(這將詢問您的密碼),以及

    echo 100 | sudo tee /sys/devices/platform/i8042/serio1/serio2/speed
    

    速度為100.一旦找到適合您的值,請使用Upstart作業永久更改:

  3. 創建一個新的udev規則

    現在我們需要在係統啟動期間應用設置。因此,按Alt + F2,鍵入gksu gedit /etc/udev/rules.d/trackpoint.rules,然後按Enter(這將詢問您的密碼)。然後粘貼以下內容:

    SUBSYSTEM=="serio", DRIVERS=="psmouse", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTR{sensitivity}="220", ATTR{speed}="110"
    

    (更新)由於不推薦使用WAIT_FOR,因此在較新的係統上,您可以使用DEVPATH代替:

    SUBSYSTEM=="serio", DRIVERS=="psmouse", DEVPATH=="/sys/devices/platform/i8042/serio1/serio2", ATTR{sensitivity}="220", ATTR{speed}="110"     
    

    保存文件,然後重新啟動或運行上麵的命令:

    sudo udevadm control --reload-rules
    sudo udevadm trigger 
    

次佳解決方案

那麽,是什麽幫助我讓觸控點變得更加敏感。

1.簡易方法是在終端做:

 $ xinput --list --short

你會看到這樣的東西:

omicron@omicron:~$ xinput --list --short
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint    id=10.  [slave  pointer  (2)]
⎜   ↳ ImPS/2 Generic Wheel Mouse                id=12   [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)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint    id=9    [slave  keyboard (3)]
    ↳ Eee PC WMI hotkeys                        id=11   [slave  keyboard (3)]

2.找到您的跟蹤點設備。在我的情況下,它是id = 10。

3.然後在終端:

$ xinput --set-prop "10" "Device Accel Constant Deceleration" 0.5

“10”這裏是設備ID(Lite-On技術公司的ThinkPad USB鍵盤,TrackPoint id = 10),在這裏放置你的ID,”0.5″是靈敏度級別。您可以通過將大於0的數字放到1000來試驗靈敏度。但您可以定義不需要它。數字越小,速度越高。

我用0.4或0.45

4.重要。選擇速度後,將最後一個腳本複製到自動啟動。

hardware,mouse,thinkpad,input-devices,udev,ubuntu

附:如果設置一天停止工作,請再次檢查ID。您的設備表可能會有一些更改,ID可能會發生變化。

希望它會對你有所幫助。

享受你的ThinkPad!

第三種解決方案

對於我的Thinkpad T530和Ubuntu 15.10。隻需使用:

sudo -i gedit /etc/udev/rules.d/10-trackpoint.rules

然後添加以下內容,然後重新啟動。設定值將保留。

ACTION=="add",
SUBSYSTEM=="input",
ATTR{name}=="TPPS/2 IBM TrackPoint",
ATTR{device/sensitivity}="190",
ATTR{device/speed}="180",
ATTR{device/inertia}="6",
ATTR{device/press_to_select}="0"

第四種方案

@ vitaly-dubyna有正確的答案。在debian上,他的方法完美無瑕。為了讓您的生活更輕鬆,請在主目錄中放置一個文件.xsessionrc,其中包含所有設置,以便在每次重新啟動後加載它。

製作新文件使用vimpicogedit

vim .xsessionrc 

然後堅持這個

xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 200
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 7 6 4 5
xinput set-prop "TPPS/2 IBM TrackPoint" "Device Accel Constant Deceleration" 0.4

前4行是用軌跡點設置垂直和水平滾動,最後一行是控製速度和靈敏度。

請注意,由於設備ID可能會根據BIOS中是否啟用某些輸入設備而更改,因此最好在引號中使用設備名稱。對於大多數thinkpads,TPPS/2 IBM TrackPoint是參考。


**編輯:** 2015年11月

#get the device ID for the trackpad. We know it contains the string "TPPS"
ibm_trackpad_id=$(xinput | grep 'TPPS' | cut -d"=" -f2 | cut -f1)
echo $ibm_trackpad_id > ~/temp/ibm_trackpad_id

#set desired params for trackpoint
xinput set-prop $ibm_trackpad_id "Evdev Wheel Emulation" 1
xinput set-prop $ibm_trackpad_id "Evdev Wheel Emulation Button" 2
xinput set-prop $ibm_trackpad_id "Evdev Wheel Emulation Timeout" 200
xinput set-prop $ibm_trackpad_id "Evdev Wheel Emulation Axes" 7 6 5 4
xinput set-prop $ibm_trackpad_id "Device Accel Constant Deceleration" 0.15

# get wireless mouse device ID 
logitech_mouse_id=$(xinput | grep "Logitech" | cut -d"=" -f2 | cut -f1)
echo $logitech_mouse_id > ~/temp/logitech_mouse_id

# this is device dependent. Map the buttons on your mouse the functionality you want. 
xinput set-button-map $logitech_mouse_id 1 2 3 4 5 6 7 9 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

# set props for external mouse
xinput set-prop $logitech_mouse_id "Device Accel Constant Deceleration" 1.7
xinput set-prop $logitech_mouse_id "Device Accel Adaptive Deceleration" 2
xinput set-prop $logitech_mouse_id "Evdev Wheel Emulation" 1
xinput set-prop $logitech_mouse_id "Evdev Wheel Emulation Axes" 7 6 5 4
xinput set-prop $logitech_mouse_id "Evdev Wheel Emulation Button" 8

第五種方案

(1)通過xorg.conf.d和udev配置libinput選項

從Ubuntu 17.10開始,該標準現在是libinput驅動程序。

它的一些選項可以通過X.org機製進行配置,但需要使用udev規則配置速度和靈敏度以放入內核驅動程序參數。 (請參閱answer by @htorque。)

要配置其他選項,請創建文件/etc/X11/xorg.conf.d/52-trackpoint-tweaks.conf(或類似名稱)。該文件應具有以下內容:

Section "InputClass"
    Identifier         "Trackpoint tweaks"
    MatchProduct       "TPPS/2 IBM TrackPoint"
    MatchDevicePath    "/dev/input/event*"

    # The default driver now, so optional to put in this line. 
    # But does not hurt mentioning where the options will go.
    Driver             "libinput"

    Option             "NaturalScrolling"      "true"
EndSection

要查看效果,您必須重新啟動X.有關其他可用X.org選項的列表,請參閱man(4) libinput

有關相應(但名稱不同)的xinput屬性的列表,請參閱xinput --list-prop "TPPS/2 IBM TrackPoint"或再次使用man(4) libinput。您可以使用這些命令立即使用xinput --set-prop […]命令測試效果,而無需每次都重新啟動X.然後使用52-trackpoint-tweaks.conf文件中的等效項使更改成為永久更改,如上所示。

(2)通過xorg.conf.d配置evdev選項

evdev驅動程序是早期版本的Ubuntu中trackpoint的默認驅動程序,但是從Ubuntu 17.10開始,下麵的方法已被棄用,並且不再開箱即用。這是因為evdev驅動程序現在不再作為libinput驅動程序安裝,如上所述。

如果需要,在使用sudo apt install xserver-xorg-input-evdev(source)安裝驅動程序後,仍然可以使用下麵的evdev解決方案。

一切都可以很好地配置在/etc/X11/xorg.conf.d/52-trackpoint-tweaks.conf文件中(或類似命名 – 在Ubuntu上,你必須創建目錄和文件,但機製可以工作;在某些版本中,其中一個目錄名稱可能是x11而不是X11)。

該文件應具有以下內容:

Section "InputClass"
    Identifier "Trackpoint tweaks"
    MatchProduct       "TPPS/2 IBM TrackPoint"
    MatchDevicePath    "/dev/input/event*"

    # Specify the driver, as else Ubuntu 17.10 will use libinput.
    Driver             "evdev"

    # Configure wheel emulation, using middle button and "natural scrolling".
    Option             "EmulateWheel"            "on"
    Option             "EmulateWheelButton"      "2"
    Option             "EmulateWheelTimeout"     "200"
    Option             "EmulateWheelInertia"     "7"
    Option             "XAxisMapping"            "7 6"
    Option             "YAxisMapping"            "5 4"

    # Set up an acceleration config ("mostly linear" profile, factor 5.5).
    Option             "AccelerationProfile"     "3"
    Option             "AccelerationNumerator"   "55"
    Option             "AccelerationDenominator" "10"
    Option             "ConstantDeceleration"    "3"
EndSection

要查看效果,您必須重新啟動X.要在X運行時使用這些設置,請使用xinput,但請注意選項名稱在那裏不同。

正如@Vitaly Dubyna所指出的,”Constant Deceleration”可用於控製靈敏度 – 它可以縮小所有移動因子,因此值”3″使所有移動速度比默認”1″慢3倍。

選項文件:

參考資料

本文由Ubuntu問答整理, 博文地址: https://ubuntuqa.com/zh-tw/article/2580.html,未經允許,請勿轉載。