This is a patch adding some extra functionality to the Linux USB touchscreen driver. It adds features useful in developing and testing applications on touch-screens, as well as the ability to reverse the x and/or y axes — not every tablet out there deﬁnes its axes the same way.
Download this patch and then run the usual:
Then compile your kernel as usual. If you're updating the module, you don't need to compile your entire kernel (but it's probably a good idea if you're not sure you know what this is):
How to Use It
Simply insert the driver as per usual. The touchscreen device is exposed as an event device (
/sys/class/input for more information on what's what.
There is one module option,
swap_xy. It swaps the X and Y axes.
Module options may be set in the
sys ﬁlesystem by modifying the ﬁle nodes in
The patch adds three new options to this module:
- Reverses the X axis. This happens after the swap_xy option has taken eﬀect. Figure out the axes orientation ﬁrst.
- Likewise, reverses the Y axis.
- During development of your touchscreen application, you will probably not want it to issue mouse events to X11. Enable this option and the touchscreen driver will report its co-ordinates using the event layer's
0x11) absolute axes instead of
All of these may be changed after the modules have been inserted by writing Y or N to the ‘ﬁles’ in directory /sys/module/usbtouchscreen.
To enable those at module loading time, say something like this:
I have two versions of the patch tested against Linux 2.6.18 (the original one), and 2.6.25, where some event driver symbols got changed in the kernel. I'm unsure exactly when the change happened. If you have a kernel between 2.6.18 and 2.6.25 (why?), I recommend trying the newer patch ﬁrst, then the older one if that doesn't work.