Enable/Disable touch pad

potyl on 2009-10-05T06:50:13

I use a MacBook as my main computer. I work on that laptop and do all my random hacking on it as well.

What might seem odd is that I run Linux on that hardware. Installing Linux there and getting it to work properly requires a lot of work and sacrifice: the web cam doesn't work and the OS sees a single CPU. Otherwise all is working fine and if the proper software (fan control) is installed the laptop won't overheat. I can even play an OpenGL game in Perl!

One thing that I have noticed since I work on this MacBook is how clumsy I can be while typing. I would always hit the huge track pad and destroy my own work! OS X has a feature to disable the touch pad when a mouse is plugged and I would like to have the same feature in Linux. I think that the next version of Gnome will have this feature, but I want something like that now.

Luckily in Linux we have all the tools to implement this. What's missing is something to put all the pieces together, something like a glue language. So I wrote a small Perl script that can toggle the touch pad for me: toggle-touchpad. I binded the script to a keyboard combination through my window's manager keybindings and I can now enable/disable the touch pad at will!

This script will only work if the synaptic touch pad is configured to use shared memory. This means that the following option has to be set in the synaptic's driver section of your X11 configuration file:

Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
        Option          "HorizScrollDelta"      "0"

        # Use shared memory
        SHMConfig       "On"
EndSection

Once the driver is configured to use shared memory the touch pad settings can be modified at runtime without needing to restart the X server. The program synclient can be used for playing around with the touch pad's settings. Once that done disabling the touch pad is as simple as doing:

synclient touchpadoff=1

Voila!


touchfreeze & unclutter

daxim on 2009-10-05T10:41:27

When typing touchfreeze turns off the touchpad, unclutter hides the pointer.

Re:touchfreeze & unclutter

potyl on 2009-10-05T11:10:28

Cool but that program works on windows :( On the other hand the documentation says that it works like syndaemon on x-window! I should give it a try!

Re:touchfreeze & unclutter

daxim on 2009-10-09T10:46:56

No, these are Linux programs.

touchfreeze

unclutter

Re:touchfreeze & unclutter

potyl on 2009-10-09T18:34:41

I got confused because this is what I found with google: touchfreeze. I guess that I wasn't feeling lucky :)

Possible fixes for your issues

cowens on 2009-10-05T13:35:23

I don't know about MacBooks, but my MacBook Pro's iSight works just fine if I load the right driver. See this thread on how to get it to work with Ubuntu: http://ubuntuforums.org/showthread.php?t=225621.

Seeing one CPU is most likely a result of using the wrong kernel. Look for an SMP version of the kernel to take advantage of the second core (the default Ubuntu Kernel works just fine for me).

You may want to look into the options on syndaemon, it can disable the touchpad while you are typing: https://help.ubuntu.com/community/SynapticsTouchpad#Disabling%20the%20Touchpad%2 0Temporarily%20While%20Typing

Re:Possible fixes for your issues

potyl on 2009-10-05T17:09:35

I don't know about MacBooks, but my MacBook Pro's iSight works just fine if I load the right driver.

The latest version of the MabBook Pro has no problem with the video camera. But under the latest MacbBook it doesn't work.

Seeing one CPU is most likely a result of using the wrong kernel.

The missing CPU is not related to the kernel type. It's a well known kernel bug which causes the MacBook not to boot.

As surprising as it might seem the latest MacBookPro works better under Linux than the latest MacBook. A colleague has the new MabBoookPro and installing Ubuntu there was quite easy, when I tried to install the same OS in the MacBook I was set for a nice ride!

You may want to look into the options on syndaemon.

Definitely!