Touchkit USB mini-HowTo ======================== written by Daniel Ritz Document last updated for kernel 2.6.15. Hardware ~~~~~~~~ Touchkit is the name of eGalax touch screens found for example in Xenarc touch screen monitor. They have an USB, RS323, PS/2 or I2C interface. Only the USB variant is currently supported. Driver ~~~~~~ While eGalax provides a driver for the thing, it's a hack IMO, not fit for a modern 2.6 kernel. That's what touchkitusb.c is for. It is a linux 2.6 input subsystem driver, based on mtouchusb.c. Both do more or less the same: get the events form hardware, forward them to the input layer. touchkitusb.c is just the kernel space driver. For use with xorg/XFree86 another driver is needed that is able to understand the raw event interface the kernel provides. Also the X driver has to do the calibration since the kernel driver only gives the raw data, which is for this device 0-2047 in x and y directions. The driver i'm using in xorg/XFree86 is the evtouch driver, originaly written for Siemens Lifebook, but also works fine with any other touchscreen as long as the configuration is right. Configuring the kernel ~~~~~~~~~~~~~~~~~~~~~~ now make sure the touchkit and the evdev drivers are compiled: do a make menuconfig, select at least: Device Drivers ---> Input device support ---> Event interface USB support ---> eGalax TouchKit USB Touchscreen Driver (continue building the kernel as usual) Configuring user space ~~~~~~~~~~~~~~~~~~~~~~ - make sure you have a recent hotplug package (2004_01_05 and newer are known to work. olders may work too but i never tested any :) http://www.kernel.org/pub/linux/utils/kernel/hotplug/ - get a copy of the evtouch xorg/XFree86 driver at: http://stz-softwaretechnik.com/~ke/touchscreen/evtouch.html - build the evtouch driver or if you are lazy as i am: use the compiled version that come as .tar.gz in the .tar.gz - copy evtoch_drv.o to /usr/X11R6/lib/modules/input/ - plug the touchscreen - hotplug should load the touchkitusb driver - modprobe evdev (if it's not already loaded) - cat /proc/bus/input/devices to get an overview of the input devices. look for the eGalax thing, look at the handler line. it should be something like H: Handlers=mouse0 event3 the event3 is important here, it may be different. - make sure /dev/input/eventX exists (more than one) if they don't exist: mknod /dev/input/event0 c 13 64 mknod /dev/input/event1 c 13 65 mknod /dev/input/event2 c 13 66 mknod /dev/input/event3 c 13 67 (and so one, max is event31, but 0-3 should be enough) - to make sure autoloading evdev works, put something like alias char-major-13-67 evdev into /etc/modprobe.conf (13-67 is for event3, yours might differ) - run ./make_calibrator this should build the calibration program. you need to have the xorg-devel/ XFree86-devel packet installed. - fire up X (use the mouse, not the touchscreen) - from a xterm or konsole or whatever run ./calibrator /dev/input/event3 and touch the 4 points (the calibrator reads the data directly from the device file, so don't worry about X config yet) after you touched the 4 points it waits a bit, then quits. on the xterm you see the ready to copy calibration data for xorgconfig/XF86Config - time to edit xorgconfig/XF86Config: * add a new section: Section "InputDevice" Identifier "touchscreen0" Driver "evtouch" Option "Device" "/dev/input/event3" Option "DeviceName" "touchscreen" Option "MinX" "62" Option "MinY" "1910" Option "MaxX" "1966" Option "MaxY" "45" Option "ReportingMode" "Raw" Option "SendCoreEvents" EndSection (with the correct device file for your configuration of course. and the calibration data) * check the section for the mouse device. make sure the mouse points to /dev/inpu/mouse0 (or mouse1 or whatever). like this: Section "InputDevice" Identifier "Mouse0" Driver "mouse" Option "Device" "/dev/input/mouse0" Option "Protocol" "PS/2" # all the other stuff EndSection (/dev/mice, /dev/psaux and /dev/input/mice are not working since the kernel mouse interface gets the events from the touchscreen also, but since it's raw data, the pointer movements are not usable.) * find the line: InputDevice "Mouse0" "CorePointer" * below that line add this: InputDevice "touchscreen0" "SendCoreEvents" * save the file - restart X - happy touching X/Y Swapped ~~~~~~~~~~~ in /etc/modprobe.conf add the line: options touchkitusb swap_xy=1 alternatively you can do it after the module was loaded by doing (as root): echo Y > /sys/modules/touchkitusb/parameters/swap_xy