当前位置: 首页>>技术问答>>正文


配置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/article/2580.html,未经允许,请勿转载。