Touchscreening.

A couple of weeks ago I headed over to the legendary North Rocks Computer Markets with my girlfriend's father to look for RAM for his laptop.

To cut a long story short, he ended up with a no RAM, and I ended up with a dock for my laptop and a 12" LCD touchscreen.

The dock was an absolute bargain, and i've always wanted a touchscreen to play with - the price was right, so my money and I were soon parted.

I've been playing with the touchscreen on and off for the last few weeks, but last night at a school friend's LAN party around 4am I managed to get it working almost perfectly with Xorg. The goal was to get it going under Linux so we could play emulated Starcraft on a touchscreen. :-)

Some tech specs on the touchscreen: it's a 12" 3M Microtouch with a standard VGA connection for the monitor, serial connection for the touchpad, audio input and built in speakers.

As for what model 3M Microtouch it is, I have absolutely no idea. The 3M website provides no clues, but the microtouch driver in Xorg reports it as either an SMT2, SMT3V, or SMT3RV. For identifying marks, Google doesn't give any meaningful results when submitted various serials posted all over it, however there is a "CML" branded sticker on the back.

A few days ago I noticed that the new POS systems with touchscreens that Coles have been rolling out in some Sydney stores are identical to the Microtouch that I picked up. Unfortunately the driver that came with the screen was Windows only, leaving me practically no point of reference to begin my search and testing from.

Nonetheless, I managed to work out that it uses the microtouch driver supplied in XFree and Xorg, but as for usable driver paramaters to actually get the touch component of the screen going, there only seems to be one configuration posted on the intarweb that everyone uses.

Unfortunately, that configuration doesn't have the correct screen input dimensions needed by the driver to accurately position the cursor, so when you move your finger over the screen the cursor accelerates faster that your finger. This means that the cursor overshoots the user interface element that you're trying to interact with by between 1 and 4cms, making it reasonably difficult to select or manipulate anything.

A bit of prodding and probing got the input working pretty reliably, although at times the cursor can be slightly to the right of the button that you're clicking, forcing the button to be tapped again to trigger. A bit of tweaking has mostly sorted this out, resulting in the following Xorg Microtouch configuration:

Section "InputDevice"
        Identifier      "ts0"
    Driver      "microtouch"
    Option      "Device"    "/dev/ttyS0"
    Option      "MinX"      "700"
    Option      "MaxX"      "16450"
    Option      "MinY"      "15800"
    Option      "MaxY"      "300"
    Option      "ReportingMode" "Scaled"
    Option      "SendCoreEvents"
EndSection

The most import section of the configuration would have to be the min and max X and Y values, as they tell the driver the size of the screen and where the cursor should be in relation to finger input. And yes, the MinY value is meant to be larger than the MaxY, but I have no idea why - it just works that way!

I'm finding it to be accurate 98% of the time, but with a bit of tweaking every now and then i'll surely be able to sort out the last few niggling accuracy issues.