thinkpad t420s在centos/linux上启用指点杆中键竖直水平滚动功能

在thinkpad t420s上使用centos 6, centos 6 在驱动支持方面已经比较完善,基本不需要另外安装驱动即可。不过指点杆小红帽没有中键功能没有打开,这点还是不方便的(虽然触摸板双指滚动是可以通过gui设置界面启用的)。

从thinkwiki里看到开启方式http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint

按其中 Configuration using xinput一节,使用root账号执行命令

xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 8 2
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 8 200

其中第三条命令执行有错误,但没有影响正常使用。再执行以下命令

xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 8 6 7 4 5
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Middle Button Emulation" 8 1
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Middle Button Timeout" 8 50

执行完毕,不需要重启,连X都不用重启就可以使用中键滚动功能了。

至于原因,并不很清楚,这些都是linux 的外围功能,个人感觉没必要深入研究。

上该方法应该可以用在fedora,redhat等发行版上,不过没有测试。

还有一点很重要的是,使用这几行命令启用中键滚屏功能,注销登录后就失效。可以把这它们写成shell脚本,设置为gnome登录后自动启动。经测试,只需写入下面三行命令即可以。

#!/bin/bash
# for thinkpad trackpoint, middle key scroll screen
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 8 2
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 8 6 7 4 5

——————

执行命令输出,仅供参考:

[root@fsc feng]# xinput list-props “TPPS/2 IBM TrackPoint”
Device ‘TPPS/2 IBM TrackPoint’:
Device Enabled (112):    1
Device Accel Profile (233):    0
Device Accel Constant Deceleration (234):    1.000000
Device Accel Adaptive Deceleration (236):    1.000000
Device Accel Velocity Scaling (237):    10.000000
Evdev Reopen Attempts (230):    10
Evdev Axis Inversion (238):    0, 0
Evdev Axes Swap (240):    0
Axis Labels (241):    “Rel X” (120), “Rel Y” (121)
Button Labels (242):    “Button Left” (113), “Button Middle” (114), “Button Right” (115), “Button Wheel Up” (116), “Button Wheel Down” (117)
Evdev Middle Button Emulation (243):    2
Evdev Middle Button Timeout (244):    50
Evdev Wheel Emulation (245):    0
Evdev Wheel Emulation Axes (246):    0, 0, 4, 5
Evdev Wheel Emulation Inertia (247):    10
Evdev Wheel Emulation Timeout (248):    200
Evdev Wheel Emulation Button (249):    4
Evdev Drag Lock Buttons (250):    0
[root@fsc feng]# xinput set-int-prop “TPPS/2 IBM TrackPoint” “Evdev Wheel Emulation” 8 1
[root@fsc feng]# xinput set-int-prop “TPPS/2 IBM TrackPoint” “Evdev Wheel Emulation Button” 8 2
[root@fsc feng]# xinput set-int-prop “TPPS/2 IBM TrackPoint” “Evdev Wheel Emulation Timeout” 8 200
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request:  140 (XInputExtension)
Minor opcode of failed request:  57 ()
Serial number of failed request:  18
Current serial number in output stream:  19
[root@fsc feng]# xinput set-int-prop “TPPS/2 IBM TrackPoint” “Evdev Wheel Emulation Timeout” 8 200^C
[root@fsc feng]# xinput set-int-prop “TPPS/2 IBM TrackPoint” “Evdev Wheel Emulation Timeout” 8 200
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request:  140 (XInputExtension)
Minor opcode of failed request:  57 ()
Serial number of failed request:  18
Current serial number in output stream:  19
[root@fsc feng]# xinput set-int-prop “TPPS/2 IBM TrackPoint” “Evdev Wheel Emulation Axes” 8 6 7 4 5
[root@fsc feng]# xinput set-int-prop “TPPS/2 IBM TrackPoint” “Evdev Middle Button Emulation” 8 1
[root@fsc feng]# xinput set-int-prop “TPPS/2 IBM TrackPoint” “Evdev Middle Button Timeout” 8 50
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request:  140 (XInputExtension)
Minor opcode of failed request:  57 ()
Serial number of failed request:  18
Current serial number in output stream:  19

 

发表评论?

1 条评论。

  1. Hi great blog~
    I fail to dig the solution in English and encounter your blog, really helpful and thanks a lot!

发表评论