Saturday, December 20, 2008

eeepc, touchscreen and evtouch

I've got an eeepc 701. It seems that part of the process of owning one means that you're obliged to pimp it in some way. A buddy of mine added a blue tooth module, but I thought it'd be cool to add a touch screen.

Scratching around on Ebay, I managed to find one from VirtualVillage, ordered, waited, received, experimented and installed. It ran on WinXP after a quick install, so I thought it'd be easy enough to run under Debian. After ruining my install of Debian through a combination of ignorance and clumsy attempts to compile and install the eGalax driver provided, I reinstalled and started again. Ultimately, a stock standard install of the evtouch driver, with a few pretty much undocumented options in my xorg.conf file made everything okay.

Getting there was a bit of a pain though. I found an obscure URL http://www.postnuklear.de/xorg-patches/ after googling a bit, saw that it was an unofficial patch, googled a bit more, and it seemed like the patch had been rolled into the evtouch driver. I just added a few extra options to xorg.conf, and they seemed to work. So we basically have undocumented features in the evtouch driver. Great.

Here's the /etc/X11/xorg.conf file for future reference:



# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
Option "XkbVariant" "dvorak"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
EndSection

Section "Device"
Identifier "Configured Video Device"
EndSection

Section "Monitor"
Identifier "Configured Monitor"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
EndSection

Section "InputDevice"
Identifier "touchscreen"
Driver "evtouch"
Option "Device" "/dev/input/event3"
Option "DeviceName" "touchscreen"
Option "ReportingMode" "Raw"
Option "SendCoreEvents" "On"
Option "Rotate" "CCW"
#Option "Calibrate" "1"
Option "MinX" "266"
Option "MinY" "95"
Option "MaxX" "1889"
Option "MaxY" "1957"
Option "x0" "20"
Option "y0" "-3"
Option "x1" "10"
Option "y1" "-5"
Option "x2" "-4"
Option "y2" "-8"
Option "x3" "10"
Option "y3" "1"
Option "x4" "5"
Option "y4" "-3"
Option "x5" "-5"
Option "y5" "-5"
Option "x6" "3"
Option "y6" "8"
Option "x7" "0"
Option "y7" "4"
Option "x8" "-10"
Option "y8" "5"
Option "MoveLimit" "0"
Option "touched_drag" "1"

Option "longtouched_action" "down"
Option "longtouched_button" "3"
Option "maybetapped_action" "click"
Option "maybetapped_button" "1"
Option "touched_drag" "1"
Option "oneandahalftap_button" "0"
Option "TapTimer" "30"
Option "LongtouchTimer" "500"

EndSection

Section "InputDevice"
Identifier "dummy"
Driver "void"
Option "Device" "/dev/input/mice"
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "touchscreen" "CorePointer"
# InputDevice "dummy"
EndSection