As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label Synaptics. Show all posts

Having little fun with touchpad:

https://i.ytimg.com/vi/HrSgK9pe0Ko/sddefault.jpg

A/V out of sync, sorry about that!

Its a Bash script, you will need to enable SHMConfig for monitoring touchpad activity. I divided my touchpad into 3x2 cells, each with one audio file from /usr/share/sounds. The sound files may not be available on your system, just edit the script for audio files you have.

Synaptics actually provides three programs, called Just for Fun. They are Windows-only, which is not much of a surprise. I dont know how exactly these programs are, how much fun they could be. But I decided to create a simple one of my own.

After I have a working code, I realized there is a thing called keyboard and it would work even better than touchpad. Just I made this, well, because I can.

I was thinking to allow multiple tapping, but thats not very possible. Even though there is information about how many fingers on touchpad, but you dont have the position of each finger, only the first ones.

Back in December, 2008, I posted Proper way to turn on SHMConfig in X Server 1.5 with input hotplugging, that was when HAL had not been deprecated. I checked my un-merging log, HAL was removed from my system in December, 2010, two years later of the post.

According to man synaptics, since X server 1.6, you don't need SHMConfig for changing settings on the fly via synclient. However, the -m touchpad activity monitoring option still requires SHMConfig, or you will get the same old error message:
Can't access shared memory area. SHMConfig disabled?
I have a plan for monitoring activity of touchpad, so I tried to turn it on again and the proper way is to edit /usr/share/X11/xorg.conf.d/50-synaptics.conf:
Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchDevicePath "/dev/input/event*"
        MatchIsTouchpad "on"
        Option "SHMConfig" "on"
EndSection
The lines in bold text were what I added to it, the rest were the original content. I found out /dev/input/event* is crucial to get SHMConfig turned on. Without it, I still got the same error message saying SHMConfig disabled. I don't know if it also affects other options, but you don't actually need to put touchpad options here, you can change in your ~/.xinitrc or write a startup script.

If you don't have the file, then just create one in the same directory or one listed in man xorg.conf, X server looks into many different directories for configuration files.

Your X probably doesn't have xorg.conf but automatically detect devices. Since Fedora 9, there is no xorg.conf after installing.

I just want to turn on the SHMConfig in order to change some settings of Synaptics touchpad. I then found out I need to create a configuration file, but the fact is not necessary. I only need to add a setting to /usr/share/hal/fdi/policy/20thirdparty/10-synaptics.fdi:
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.touchpad">
      <match key="info.product" contains="Synaptics TouchPad">
    <merge key="input.x11_driver" type="string">synaptics</merge>
    <merge key="input.x11_options.SHMConfig" type="string">on</merge>
      </match>
      <match key="info.product" contains="AlpsPS/2 ALPS">
    <merge key="input.x11_driver" type="string">synaptics</merge>
      </match>
      <match key="info.product" contains="appletouch">
          <merge key="input.x11_driver" type="string">synaptics</merge>
      </match>
      <match key="info.product" contains="bcm5974">
          <merge key="input.x11_driver" type="string">synaptics</merge>
      </match>
    </match>
  </device>
</deviceinfo>
This file ships with Fedora 10 with an added line:
<merge key="input.x11_options.SHMConfig" type="string">on</merge>
That will enable SHMConfig after your restart X.

By the way, if you want to auto-disable the touchpad while external mouse attached, add a /etc/udev/rules.d/50-synaptics.rules with content as follows:
ACTION=="add", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient -s TouchpadOff=1"
ACTION=="remove", SUBSYSTEM=="input", ID_CLASS="mouse", RUN+="/usr/bin/synclient -s TouchpadOff=0"
You should see the touchpad being disabled/enabled if you plug/unplug a mouse without restart X.

You can read more about touchpad and input hotplugging on ArchWiki.

Updated on 2009-10-26: Added -s to synclient command, newer version requires specifying the use of SHM. Without that argument, the root account (or whom run the synclient) couldn't be able to set the touchpad's parameters.