Configuring the touchpad with xinput
From MEPIS Documentation Wiki
Xinput is a utility to configure and test input devices under Xorg. This page describes how to use it to enable multitouch on a laptop's touchpad. This will allow you, among others, to use two-finger scrolling and two-finger tapping to emulate a middle button mouse click.
Installation and configuration
First, install xinput using Synaptic or APT.
Once installed, xinput can be used to list and set properties of your input devices. All commands can be run as a regular user - no need to be root.
To see what input devices are available, run this command in a terminal:
Your touchpad device should be listed there. Its full name should be used in the commands below. In this example, "SynPS/2 Synaptics TouchPad" is used, but make sure to use your device name instead.
To see what the current settings for the touchpad are, run:
xinput --list-props "SynPS/2 Synaptics TouchPad"
You can now set some properties to see if it works. For example, to enable both vertical and horizontal two-finger scrolling:
xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Scrolling" 1 1
http://www.mepis.org/docs/en/index.php?title=40_likes_na_foto_que_eu_postei_31 You can test by running:
xinput test "SynPS/2 Synaptics TouchPad"
...or just test it in any application, as settings are applied immediately.
The properties set with "xinput --set-prop" will be lost upon reboot/logout. To make them stick, create a shell script that is executed whenever you log in to KDE.
Using your favorite editor, create a script with the following contents and save it as e.g. "touchpad.sh".
#!/bin/bash xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Pressure" 4 # Below width 1 finger touch, above width simulate 2 finger touch. - value=pad-pixels xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Width" 8 # vertical scrolling, horizontal scrolling - values: 0=disable 1=enable xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Scrolling" 1 1 # vertical, horizontal, corner - values: 0=disable 1=enable xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Edge Scrolling" 0 0 0 # stabilize 2 finger actions - value=pad-pixels xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Jumpy Cursor Threshold" 250 # pad corners rt rb lt lb tap fingers 1 2 3 (can't simulate more then 2 tap fingers AFAIK) - values: 0=disable 1=left 2=middle 3=right etc. (in FF 8=back 9=forward) xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Tap Action" 0 0 0 0 1 2 3 exit
Make the script executable:
chmod 755 touchpad.sh
Now run the script and see if it works.
Finally, to ensure that the script is executed on every KDE login, go to System Settings > Startup and shutdown > Autostart. There, click "Add script" and add your script, checking "Create as symlink". For those who prefer the command line, the same effect is reached by creating a symlink to the script under ~/.kde/Autostart.
Tips and tricks
- Tweak the sensitivity of the touchpad by changing "Jumpy Cursor Threshold" and "Two-Finger Width". For example, values of 100 and 6, respectively, give much more sensitivity.
- Two-finger scrolling works great in combination with smooth scrolling in Firefox! (Enable in Firefox under Preferences > Advanced > General.)
- In KDE System Settings > Input Devices > Touchpad, the two-finger scrolling and tapping options might still be disabled. Just leave them as they are, it will work anyway. :-)
- See the man page for xinput for all possible settings and options.