Results 1 to 10 of 23

Thread: Touchpad Control

Threaded View

  1. #1
    Senior Member
    Join Date
    Jan 2011
    Posts
    242

    Touchpad Control

    There are two drawbacks to using a laptop: the touchpad and the touchpad.

    First, you are typing something and the touchpad decides you've tapped in the secret code for "destroy, destroy, frustration is irrelevant" and whatever it was you were doing is gone.

    Second, this still happens even though you've plugged in an external mouse and aren't using the touchpad at all.

    The route to solving the first problem is through syndaemon and the route to solving the second is through synclient. Both are command line apps already installed in Knoppix (6.4.4. at least).

    To get the right settings automatically when Knoppix start-ups you need an additional script in /etc/X11/Xsession.d and to get the settings to change automagically when you plug-in or unplug a USB mouse, you need to add an extra pair of rules to /etc/udev/rules.d.

    There are examples of how to do this out there but they usually start with someone complaining what used to work has stopped and could they crib a new solution from someone who has already done all the hard work.

    Seems Knoppix is no exception and none of the solutions out there work. Seems xhost + is missing somewhere for sentimental reasons or perhaps Knoppix is just using a very new X server with new and improved security (the kind that got Windows Vista such a bad name).

    Here's my take on this:

    Code:
    # /etc/udev/rules.d/75-touchpad.rules
    # Disable touchpad when USB mouse is plugged in and reenable when USB mouse is removed
    
    ACTION=="add",    SUBSYSTEM=="input", ENV{ID_INPUT_MOUSE}=="1", RUN+="/etc/X11/Xsession.d/50touchpad 1"
    ACTION=="remove", SUBSYSTEM=="input", ENV{ID_INPUT_MOUSE}=="1", RUN+="/etc/X11/Xsession.d/50touchpad 0"
    
    # EOF
    and

    Code:
    #!/bin/sh
    # /etc/X11/Xsession.d/50touchpad
    
    if pidof X >/dev/null; then
    
      # Turn touchpad off when a USB mouse is present
    
      pidfile=/var/run/syndaemon.pid;
    
      if [ -n "${XAUTHORITY}" ]; then
        # Xsession initialisation
    
        if lsusb -v 2>/dev/null | grep -qF Mouse; then
          synclient TouchpadOff=1;
        else
          syndaemon -d -t -k -p $pidfile;
        fi
      else
        # udev hotplug event
    
        DISPLAY=":0";
        USER=$(who | awk "/ $DISPLAY /"'{print $1}');
        XAUTHORITY=/home/$USER/.Xauthority;
        export DISPLAY XAUTHORITY;
    
        synclient TouchpadOff=$1;
    
        if [ "$1" -eq 1 ]; then
          [ -f $pidfile ] && kill $(cat $pidfile);
          [ -f $pidfile ] && sync;
        else
          [ ! -f $pidfile ] && syndaemon -d -t -k -p $pidfile;
          [ ! -f $pidfile ] && sync;
        fi
      fi
    
    fi
    
    # EOF
    The second must be executable as it is called by the rules in the first.

    Enjoy.
    Last edited by Forester; 03-17-2011 at 11:30 PM.

Posting Permissions

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


Cisco UCS LSI MegaRAID 9271CV-8I SAS2308 PCIe SAS Internal RAID Controller picture

Cisco UCS LSI MegaRAID 9271CV-8I SAS2308 PCIe SAS Internal RAID Controller

$28.00



Intel PCIe SSD AIC RAID Controller Card G97168-252 picture

Intel PCIe SSD AIC RAID Controller Card G97168-252

$44.55



ACASIS 2.5/3.5 inch 2 Bay SATA USB 3.0 Hard Drive Disk HDD SSD Enclosure 4 RAID picture

ACASIS 2.5/3.5 inch 2 Bay SATA USB 3.0 Hard Drive Disk HDD SSD Enclosure 4 RAID

$58.99



Oracle 7085209 LSI MegaRAID SAS 9361-8i 1GB Cache 12Gbps SAS/SATA PCIe RAID Card picture

Oracle 7085209 LSI MegaRAID SAS 9361-8i 1GB Cache 12Gbps SAS/SATA PCIe RAID Card

$28.20



LSI MegaRAID 9361-8i 12Gb PCIe 8-Port SAS/SATA RAID 1Gb w/BBU/CacheVault/License picture

LSI MegaRAID 9361-8i 12Gb PCIe 8-Port SAS/SATA RAID 1Gb w/BBU/CacheVault/License

$39.95



LSI MegaRAID 9361-8i 12Gbps PCIe 3 x8 SATA SAS 3 8 Port RAID + BBU & CacheVault picture

LSI MegaRAID 9361-8i 12Gbps PCIe 3 x8 SATA SAS 3 8 Port RAID + BBU & CacheVault

$39.00



ORICO Multi Bay RAID Hard Drive Enclosure USB 3.0/ Type-C For 2.5/3.5'' HDD SSDs picture

ORICO Multi Bay RAID Hard Drive Enclosure USB 3.0/ Type-C For 2.5/3.5'' HDD SSDs

$82.49



LSI 9271-8i MegaRAID 8-Port 6Gbps PCIe RAID Controller w/ 1Gb CacheVault & BBU picture

LSI 9271-8i MegaRAID 8-Port 6Gbps PCIe RAID Controller w/ 1Gb CacheVault & BBU

$30.99



4 Bay RAID External Hard Drive Enclosure for 2.5/3.5

4 Bay RAID External Hard Drive Enclosure for 2.5/3.5" SATA HDD/SSD

$79.99



G TECHNOLOGY G RAID 0G04228 2-Bay Thunderbolt 2 RAID Array W/Power Supply picture

G TECHNOLOGY G RAID 0G04228 2-Bay Thunderbolt 2 RAID Array W/Power Supply

$99.99