Results 1 to 10 of 16

Thread: Howto: Configuring Touchpad

Threaded View

  1. #1
    Join Date
    Jan 2010
    65 AD
    Ubuntu Development Release

    Howto: Configuring Touchpad

    This guide will not be updated after Maverick Meerkat 10.10 unless this message is removed.

    If you have an Elantech touchpad which is being detected as "ImPS/2 Logitech Wheel Mouse" then ALLurGroceries has created a fix for it here:

    I have not seen a simple howto guide on adjusting touchpad settings so I am making one.
    For Lucid there are special instructions since it does not use HAL configuration. Lucid users should get the synclient values from step 3 then go straight to step 4b. Now for Maverick it seems we are reverting back to xorg.conf so Maverick users can check out section 4c. Purple syntax is used as a placeholder which should be replaced with proper syntax.

    step 1: research
    Open a terminal and read or scan through the manuals that may pertain to your problem.
    man synaptics #synaptics touchpad input driver manual.
    man synclient #command line utility to query and modify Synaptics driver options.
    man xinput #configures all input devices including touchpad
    man syndaemon #a program that monitors keyboard activity and disables the touchpad when the keyboard is being used.

    Step 2: update synaptics driver

    This step is probably unnecessary but is only to ensure you have the latest driver.

    sudo apt-get update
    sudo apt-get install xserver-xorg-input-synaptics

    Step 3: testing touchpad options

    Open a terminal and type:
    synclient -l
    You should see some values assigned to your touchpad options here. You should not have an 'SHMconfig error' with the latest synaptics driver but if so then please let me know about it.
    You can adjust settings temporarily through synclient by typing in terminal
    synclient OPTION=VALUE
    Open the synaptics manual 'man synaptics' to see what the different options do. There are a range of possible values for any given option but you will need to play with it to determine what they are.
    In order to adjust these values permanently you must enter them into your permanent configuration files.

    Step 4: permanent configuration
    a: HAL configuration for Karmic 9.10 and earlier
    All references to your input device should be removed from xorg.conf in order to continue.
    Use the the following command to bring up the location of the hal configuration file
    sudo find /usr/share/hal /etc/hal -name *synaptics.fdi
    The first line of output will list the path to your HAL configuration file if it exists and it should look similar to one of these:
    Open a program launcher by pressing Alt/F2 and type the following, substituting in the actual path to your configuration file.
    sudo gedit "path to configuration file"
    Enter the options and values you found to work from step 3 in the following form same as above outside the <!--example section--> and within the <match key> section recreating the line as many times as necessary to cover all your desired options and values:
    <merge key="input.x11_options.OPTION" type="string">VALUE</merge>
    Save and you are done. The configuration will be implemented the next time you reboot or restart your touchpad driver with modprobe. Then you can check the values by "synclient -l".

    b: udev configuration for Lucid 10.04
    This is the only way I have found to configure the touchpad in Lucid but it may not work with ealier releases.
    You will need to create a file to include udev rules so use Alt/F2:
    gksudo gedit /etc/udev/rules.d/touchpad.rules
    Now you should have a blank slate here to configure udev. If you already have code in touchpad.rules then you should be able to append the following code below it:
    ACTION!="add|change", GOTO="touchpad_end"
    KERNEL!="event*", GOTO="touchpad_end"
    ENV{ID_INPUT_TOUCHPAD}!="1", GOTO="touchpad_end"
    In this line: "ENV{x11_options.OPTION}="VALUE" you want to change the option and value to the ones you found to work in step 3 and make only one or recreate as many more of these lines as you need to cover all of the settings you want.

    c: xorg.conf for Maverick 10.10
    You will need to edit xorg.conf in the folder /etc/X11.
    sudo gedit /etc/X11/xorg.conf
    and add an "InputClass" section using any identifier you want and matching it to the touchpad then insert your configuration options.
    Section "InputClass"
        Identifier "Touchpad"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Option "Option" "Value"
    Here are some examples of configuration options which can be inserted in the "InputClass" section which I copied from the user documentation for Xserver.
    Option "LeftEdge" "1700"
    Option "RightEdge" "5300"
    Option "TopEdge" "1700"
    Option "BottomEdge" "4200"
    Option "FingerLow" "25"
    Option "FingerHigh" "30"
    Option "MaxTapTime" "180"
    Option "MaxTapMove" "220"
    Option "VertScrollDelta" "100"
    Option "MinSpeed" "0.06"
    Option "MaxSpeed" "0.12"
    Option "AccelFactor" "0.0010"
    Option "Repeater" "/dev/ps2mouse"

    Step 5: failsafe

    a: synclient on startup
    You have followed this guide to the end and your settings are still not being held after reboot, there is still hope. Using the synclient commands from step 3, you can place run them in a script and place it in /usr/bin so you can run it anytime or place a shortcut to it in startup applications. If the script works normally but not at statrtup you will need to add a delay at the beginning, such as "sleep 10;" so it will be executed after the boot up process is complete.
    Go to System / Preferences / StartupApplications, click the "Add" button, for "Name" enter whatever you want, and for "Command" enter the name of your script
    b: xinput on startup
    You can change settings through xinput also. First look at your touchpad properties:
    xinput list --short | grep -i 'touchpad' | grep -o '=[0-9]*' | cut -d'=' -f2 | xargs -t xinput list-props
    For a more interactive approach you can use the first part of that command:
    xinput list --short
    followed by
    xinput list-props 'id of touchpad'
    Each property has a bit size of 8,16 or 32 so you will have to try each bit size when setting the value. Values are seperated by a space so to set them use the following example:
    xinput set-int-prop  'name of touchpad in single quotes' 'name of property in single quotes' bitsize valueA valueB ........
    and of course substitute the proper syntax for "'name of touchpad in single quotes' 'name of property in single quotes' bitsize valueA valueB ......."
    Then place the setting in an executable file in /usr/bin and create a startup command for it. If the script works normally but not at statrtup you will need to add a delay at the beginning, such as "sleep 10;" so it will be executed after the boot up process is complete.

    a: toggle while typing
    This option should be available under the system's menu mouse preferences on the touchpad tab.
    You can also use the syndaemon command to disable the touchpad while typing from startup applications:
    syndaemon -i 1 -d -K
    as a startup command will cause the touchpad to be disabled while typing except when using modifier keys.
    Another way to disable the touchpad while typing on gnome desktop is in the configuration editor. Use the gconfig gui from the menu or use this command to see the touchpad settings:
    gconftool -R /desktop/gnome/peripherals/touchpad
    Use this to set disable_while_typing to true:
    gconftool -s -t bool /desktop/gnome/peripherals/touchpad/disable_while_typing true
    b: toggle shortcut
    from CommunityDocs
    Place this script in a file, make it executable and place it in /usr/bin/ so you can start it from the 'run application' dialog box.
    # toggle synaptic touchpad on/off
    # get current state
    SYNSTATE=$(synclient -l | grep TouchpadOff | awk '{ print $3 }')
    # change to other state
    if [ $SYNSTATE = 0 ]; then
        synclient touchpadoff=1
    elif [ $SYNSTATE = 1 ]; then
        synclient touchpadoff=0
        echo "Couldn't get touchpad status from synclient"
        exit 1
    exit 0
    This script will accomplish the same goal except it is designed to toggle the touchpad through xinput:
    # toggle synaptic touchpad on/off
    SYNSTATE=$(xinput list-props "SynPS/2 Synaptics TouchPad" | grep Enabled | grep -Eo '.$')
    if [ $SYNSTATE = 0 ]; then xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 1
    else xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 0; fi

    You can also toggle this script through a keypress using keyboard shortcuts. For instance, press alt/F2 and type "gnome-keybinding-properties" then click add and for name enter whatever you want and for command enter the path to the script which for me would be "/usr/bin/". So then click apply and you can set whatever key combination you wish.

    c: toggle when using usbmouse
    Make a script to disable the touchpad and one to enable it called "" and "". For convenience these can also be run from the command line.
    DISPLAY=:0 xinput list --short | grep -i 'touchpad' | grep -o '=[0-9]*' | cut -d'=' -f2 | DISPLAY=:0 xargs -I nero xinput set-int-prop nero 'Device Enabled' 8 0
    DISPLAY=:0 xinput list --short | grep -i 'touchpad' | grep -o '=[0-9]*' | cut -d'=' -f2 | DISPLAY=:0 xargs -I nero xinput set-int-prop nero 'Device Enabled' 8 1
    Now create a udev rule to enact the script when the mouse is changed and place it in /etc/udev/rules.d/:
    HTML Code:
    ACTION=="add", SUBSYSTEMS=="usb", ID_CLASS="mouse", RUN+="/bin/sh -c /usr/bin/"
    ACTION=="remove", SUBSYSTEMS=="usb", ID_CLASS="mouse",  RUN+="/bin/sh -c /usr/bin/"
    That concludes this guide. I will update it if I find there is more to add. Good luck.
    Last edited by pi/roman; January 23rd, 2011 at 08:45 PM.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts