Node:Top, Next:, Previous:(dir), Up:(dir)

This file documents Onetouch, support software for Onetouch touch panels under Linux and XFree86.


Node:General Information, Next:, Previous:Top, Up:Top

General Information

The package supports serial Onetouch touch panels under Linux and XFree86. The latest version of this driver can be downloaded from:

The latest source tree can be accessed from my CVS server, instructions are available at http://www.gnudd.com/software/#cvs . The package name to use is onetouch. As an alternative, you can use viewcvs at http://cvs.gnudd.com. The latest CVS snapshot can also be downloaded from ftp://ftp.gnudd.com/pub/onetouch .


Node:Device Support, Next:, Previous:General Information, Up:Top

Device Support

The driver has been designed to run under XFree86 version 4.x. It has been tested on 4.1 and 4.2.

In order to use the touch screen in X, you should install in your system the "onetouch_drv" module, part of this distribution.

The compiled module (onetouch_drv.o) should be copied in the module directory of your X server, usually or /usr/X11R6/lib/modules/input. When the file is in place, a proper XF86Config will arrange for its loading.

In order to recompile the module you need access to the complete X source tree, and you can compiling issuing:

make XFREE_SOURCE=<location-of-source> onetouch_drv.o

The "location of source" above should be the full path name to the directory called "xc" after you uncompress the source tar file.

XFREE_SOURCE can be defined in your environment if you prefer. Note that if the variable is defined, calling make without arguments will compile the module.

To compile onetouch you'll most likely need to compile X first (by issuing make World and waiting a huge lot of time). A freshly uncompressed source tree lacks the proper header files for compilation to succeed; since one of the errors happens inside an X header, you can only fix it by compiling X first - I can't fix things in my source.


Node:XFree Configuration, Previous:Device Support, Up:Top

XFree Configuration


Node:XFree 4.0, Next:, Previous:XFree Configuration, Up:XFree Configuration

XFree 4.0

In order to use a Onetouch device with XFree 4, you need to add an InputDevice section to your XF86Config. The following example shows how it looks like. The options that are shown commented are not implemented in this version of the module, and are ignored if specified.

Section "InputDevice"
Identifier "Touchscreen0"
Driver "onetouch"
Option "Device"            "/dev/ttyS0"
Option "BaudRate"          "9600"
#Option "CalibrationFile"  "/etc/onetouch.calib"
Option "Smoothness"        "9"
Option "TappingDelay"      "0"
Option "JitterDelay"       "50"
Option "DebugLevel"        "0"
Option "SendCoreEvents"
EndSection

Moreover, you need to add an InputDevice line in the ServerLayout section. After the addition, the section will most likely look like this:

Section "ServerLayout"
Identifier  "Simple Layout"
Screen      "Screen 1"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
InputDevice "Touchscreen0"
EndSection

Note that if your system has no mouse device, you can remove the InputDevice "Mouse1" line and add "CorePointer" to the touch screen line.

The meaning of individual options is as follows:


Identifier "Touchscreen0"
The identifier string is mandatory, and appears, literally, in the InputDevice directive within the ServerLayout section that is usually found at the end of the configuration file.
Driver "onetouch"
The name of the driver is mandatory. It is used to load the associated module. In this case the file onetouch_drv.o.
Option "Device" "/dev/ttyS0"
The device name is mandatory. It states where input data is collected from.
Option "BaudRate" "9600"
The transmission rate for serial ports. It defaults to 9600.
Option "CalibrationFile" "/etc/onetouch.calib"
The option is not currently implemented, the calibration filename is hardwired
Option "Smoothness" "9"
The smoothness of the pointer. The default value is 9. The greater the value the smoother the motion. If you need to do handwriting or similar "fast" interaction, you should set the smoothness to 0.
Option "TappingDelay" "0"
Optional selection of tapping mode. By default (tapping delay set to 0), any touch event is reported as a button press. In tapping mode the first touch event is used to move the pointer, and button press is only reported when the user taps on the device. If the delay, measured in milliseconds, between pen-up and pen-down is greater than the selected value, the pen-down even is considered motion. I personally prefer tapping mode when testing the device, as it allows me to use the common point-and-click semantics instead of click-only; this is especially true if your touchscreen is not placed over the image but in side of it (as you guess, I do that).
Option "JitterDelay" "50"
The debouncing time lapse, measured in milliseconds. If a pen-down event occurs immediately after pen-up (within this time lapse), then both events are discarded. Debouncing has been contributed by Chris Howe <chris@howeville.com>, and defaults to 50ms.
Option "DebugLevel" "0"
The level of messages spit out by the driver. The directive is optional and it defaults to 0.
Option "SendCoreEvents"
The directive instructs X to use the touch screen as a core input device (like the main mouse). This module can currently only work as a core device.


Node:Generic X Configuration, Next:, Previous:XFree 4.0, Up:XFree Configuration

Generic X Configuration

Please note that with XFree you can still use a normal mouse together with the touch panel. Also, can use the touch screen as its only pointer device.

If, when calling startx, it fails with a message of Invalid Subsection Name, please check the previous error lines, as they explain what is wrong. They usually look like:

(--) no ModulePath specified using default: /usr/X11R6/lib/modules
xf86Onetouch.so: Unknown error loading module

The messages are pretty clear, if your are careful in reading them (I am not that careful, and lose half an hour in trying to figure out what was wrong).


Node:Calibration, Next:, Previous:Generic X Configuration, Up:XFree Configuration

Calibration

To calibrate the touch panel, run the onetouch_calib script, under X.

The program needs to find onetouch_control and onetouch_to_ascii in the command search path or the current directory. It uses the control program to turn off the touchscreen in X, so the calibrator can read input data, and the conversion tool to process ASCII data instead of binary data).

In order to calibrate you'll need to move the mouse pointer first. You can do that with the warp command (see below) if no other pointer is available on the system. Using the touch panel may or may not work. Currently I have no way to disable the current calibration parameters, but I plan to fix this problem in later revisions.


Node:XFree Tools, Previous:Calibration, Up:XFree Configuration

XFree Tools

The package includes two tools that work by connecting with the X server:

onetouch_control
The program accepts on, off or info as argument. It turns the touchscreen off, turns it on, or reports information about active input devices. The program needs to connect to an X server.
warp
The program moves the mouse pointer. It can be used to move the mouse when there is no active mouse. It accepts a series of letters on the command line: each uppercase N, S, W, E moves the pointer by 100 pixels to the north, south, west, east. Each lowercase n, s, w, e moves the pointer by 10 pixels.

Table of Contents