Main question: How to get the absolute finger position on the touchpad?

I would like to get the absolute position (x, y coordinates) of a finger on a touchpad? I believe it is possible to extract it from the synaptics-family source code.

Subquestion: How to get the synaptics.h header?

I am trying to get synaptics.h so that I have access to the SynapticsHwState struct which allows to get the coordinates of a finger touching a touchpad.

This is what I've done so far:

  1. I found out that I need to download linux headers, so I ran:

    sudo apt-get install linux-headers-`uname -r`
  2. The I found the header in /usr/src/linux-headers-3.16.0-4-686-pae/include/config/mouse/ps2/synaptics.h it was EMPTY however.

  3. It turns out that headers in the include/config path are usually empty files due to some kernel building optimisations.

  4. I'm stuck. I don't know how to get this header.

Here is a link which might be helpful to answer my question. I don't understand much from what is written there however. I've tried to run make headers_install from /usr/src/linux-headers-3.16.0-4-686-pae but I got an error.

My distribution is BunsenLabs i386 Linux (a successor of CrunchBang, Debian based) with a 3.16.0-4-686-pae kernel.

  • 1
    Looks like it might be in a package named libsynaptics
    – Jeff Schaller
    Mar 26, 2016 at 0:14
  • apt-file doesn't see anything but the linux-headers packages. You're going to have to look inside the source packages, which apt-file does not index. I'd look at the kernel sources. Mar 26, 2016 at 0:26
  • @FaheemMitha There is a package called xserver-xorg-input-synaptics-dev. I've got it installed, but I still have no synaptics.h on my system. Mar 26, 2016 at 0:28
  • @MateuszPiotrowski I already said (see above) that apt-file does not find anything, other than the empty files you already referred to. Which means you aren't going to find anything in a binary package. You will have to look in the sources, probably the kernel sources. Mar 26, 2016 at 6:41
  • 1
    Try searching in codesearch.debian.net for synaptics.h, or whatever else takes your fancy. Mar 26, 2016 at 21:39

2 Answers 2


Here that file is just a bunch of #defines for constants, they presumably haven't changed in some time. And it is found at drivers/input/mouse/synaptics.h in the vanilla kernel sources.

What exactly do you want to do with this file? It is kernel internal stuff.


I didn't manage to get the synaptics.h header however I found the way to get the position (x y coordinates) of a finger on a touchpad.

The software is called evtest and the source code can be found here for example. There is a single evtest.c file and it is quite easy to modify it and extract the absolute finger position.

After all, I needed the synaptics.h only to get the coordinates. Hence I'll mark this question as solved.

  • Hello fellow programmer! Did you do it in C? I want to utilize these sources from Python but never imported non-adapted C modules in Python before...
    – scythargon
    May 25, 2020 at 10:11
  • 1
    @scythargon You may try to dig up interesting bits from here: github.com/0mp/io-touchpad May 25, 2020 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.