ubuntu下启用thinkpad小红点滚动功能
周银辉
在ubuntu下面,小红点的中键滚动功能没了,很不习惯,下面把它启动起来,
1, 一次性更改(重启后就无效了)
把下面这段脚本保存成 sh文件,比如trackPoint.sh
#
!/bin/sh
xinput list | sed -ne 's / ^[^ ][^V]. * id = \([ 0 - 9 ] * \). */ \ 1 / p' | while read id
do
case `xinput list - props $id ` in
* " Middle Button Emulation " * )
xinput set - int - prop $id " Evdev Wheel Emulation " 8 1
xinput set - int - prop $id " Evdev Wheel Emulation Button " 8 2
xinput set - int - prop $id " Evdev Wheel Emulation Timeout " 8 200
xinput set - int - prop $id " Evdev Wheel Emulation Axes " 8 6 7 4 5
xinput set - int - prop $id " Evdev Middle Button Emulation " 8 0
;;
esac
done
# disable middle button
xmodmap - e " pointer = 1 9 3 4 5 6 7 8 2 "
xinput list | sed -ne 's / ^[^ ][^V]. * id = \([ 0 - 9 ] * \). */ \ 1 / p' | while read id
do
case `xinput list - props $id ` in
* " Middle Button Emulation " * )
xinput set - int - prop $id " Evdev Wheel Emulation " 8 1
xinput set - int - prop $id " Evdev Wheel Emulation Button " 8 2
xinput set - int - prop $id " Evdev Wheel Emulation Timeout " 8 200
xinput set - int - prop $id " Evdev Wheel Emulation Axes " 8 6 7 4 5
xinput set - int - prop $id " Evdev Middle Button Emulation " 8 0
;;
esac
done
# disable middle button
xmodmap - e " pointer = 1 9 3 4 5 6 7 8 2 "
然后更改文件属性为可执行
chmod +x trackPoint.sh
然后执行之
./trackPoint.sh
2, 永久更改:
建立如下文件(如果不存在):
/usr/lib/X11/xorg.conf.d/20-thinkpad.conf
在文件中加入如下内容:
Section
"
InputClass
"
Identifier " Trackpoint Wheel Emulation "
MatchProduct " TrackPoint "
MatchDevicePath " /dev/input/event* "
Driver " evdev "
Option " EmulateWheel " " true "
Option " EmulateWheelButton " " 2 "
Option " Emulate3Buttons " " false "
Option " XAxisMapping " " 6 7 "
Option " YAxisMapping " " 4 5 "
EndSection
Identifier " Trackpoint Wheel Emulation "
MatchProduct " TrackPoint "
MatchDevicePath " /dev/input/event* "
Driver " evdev "
Option " EmulateWheel " " true "
Option " EmulateWheelButton " " 2 "
Option " Emulate3Buttons " " false "
Option " XAxisMapping " " 6 7 "
Option " YAxisMapping " " 4 5 "
EndSection
保存,重启....