Disable Touchpad while using trackpoin on Thinkpad E430

来源:互联网 发布:修剪图片的软件 编辑:程序博客网 时间:2024/05/17 03:32

Thinkpad E430 has both a trackpoint and a touchpad. The touchpad is disable when typing. However, when I'm using the trackpoint, I often touch thetouchpad as well, and generate mouse clicks I'd like to avoid. So, I need tofind out a solution to disable touchpad while I'm using trackpoint or typing.

xinput is a utility to list available input devices, query informationabout a device and change input device settings. Here's my solution:

  1. From xinput list grep touchpad device name:
    $ xinput --list | grep -i touchpad
    from outputs, I got the device's name:
    ⎜   ↳ SynPS/2 Synaptics TouchPad               id=15   [slave  pointer  (2)]
    maybe your id is not 15, but that's not matter. What we need just 'SynPS/2 Synaptics TouchPad'
  2. write
    xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 0
    into StartUp Applications Preferences

That's all right.

But after that, I make a directory in $HOME/bin and code a shell script touchpad:

#! /bin/shPATH=/sbin:/bin:/usr/bin. /lib/lsb/init-functionsdo_start() {    exec xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 1}do_stop() {    exec xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 0}case "$1" in    start)        do_start        ;;    restart|reload|force-reload)        echo "Error: argument '$1' not supported" >&2        exit 3        ;;    stop)        do_stop        ;;    *)        echo "Usage: $0 start|stop" >&2        exit 3        ;;esac
and make a link to /etc/init.d/touchpad, so when i need touchpad enable, I can type:
$ sudo /etc/init.d/touchpad start
or if I don't need it again:
$ sudo /etc/init.d/touchpad stop
That's funny.

Author: Shusheng Shaw<bluebird.shao@gmail.com>

Date: 2014-02-13 14:33:10 HKT

HTML generated by org-mode 6.33x in emacs 23

0 0