mirror of https://github.com/tLDP/LDP
139 lines
4.3 KiB
Plaintext
139 lines
4.3 KiB
Plaintext
|
<!doctype linuxdoc system>
|
||
|
<!-- LinuxDoc file was created by hand and emacs
|
||
|
Fri Dec 10 17:45:29 GMT 1999 -->
|
||
|
<article>
|
||
|
<title>Linux Touch Screen HOWTO
|
||
|
</title>
|
||
|
<author>Christoph Baumann, cgb@debian.org
|
||
|
</author>
|
||
|
<date>Dec 10, 1999
|
||
|
</date>
|
||
|
<abstract>
|
||
|
This document describes how to set up a touch screen input device under
|
||
|
XFree86. As the author had only the opportunity to work with devices
|
||
|
from EloTouch(R) and MicroTouch(R) this HOWTO is rather specific for these
|
||
|
devices.
|
||
|
</abstract>
|
||
|
<toc>
|
||
|
|
||
|
<sect>Which sort of devices are described here?
|
||
|
<p>
|
||
|
This HOWTO concentrates on devices connected via the serial port
|
||
|
i.e. /dev/ttyS0 or /dev/ttyS1.
|
||
|
</p>
|
||
|
|
||
|
<sect>How to configure the device
|
||
|
<p>
|
||
|
Touch screen devices are configured in the Xinput section in the XF86Config
|
||
|
file (mostly /etc/X11/XF86Config or /etc/XF86Config).
|
||
|
At first verify that the device driver modules exist. They are located in
|
||
|
/usr/X11R6/lib/modules/ (the modules for the above mentioned devices are
|
||
|
xf86Elo.so and xf86MuTouch.so). Now have a look into XF86Config.
|
||
|
There should be a section looking like this:
|
||
|
</p>
|
||
|
|
||
|
<p><verb>
|
||
|
Section "Files"
|
||
|
...
|
||
|
ModulePath "/usr/X11R6/lib/modules"
|
||
|
...
|
||
|
EndSection
|
||
|
</verb></p>
|
||
|
<p>
|
||
|
To get the module loaded by the X server there has to be a section like this:
|
||
|
</p>
|
||
|
<p><verb>
|
||
|
Section "Module"
|
||
|
Load "xf86Elo.so"
|
||
|
EndSection
|
||
|
</verb></p>
|
||
|
<p>
|
||
|
Now the more tricky part. X needs to know some parameters about the device.
|
||
|
The section for this looks like this (see "man XF86Config" for more details):
|
||
|
</p>
|
||
|
<p><verb>
|
||
|
Section "Xinput"
|
||
|
SubSection "Elographics"
|
||
|
#the entry for a MicroTouch device would be SubSection "MicrotouchFinger"
|
||
|
Port "/dev/ttyS1" # for a device at serial port 2
|
||
|
DeviceName "TouchScreen" #could be any unambiguous name
|
||
|
MinimumXPosition 300
|
||
|
MaximumXPosition 3700
|
||
|
MinimumYPosition 300
|
||
|
MaximumYPosition 3700
|
||
|
UntouchDelay 10 #not supported with MuTouch
|
||
|
ReportDelay 10 #not supported with MuTouch
|
||
|
EndSubSection
|
||
|
EndSection
|
||
|
</verb></p>
|
||
|
|
||
|
<p>
|
||
|
The values for the entries MinimumXPosition etc. are of course specific
|
||
|
for the setup of the hardware (i.e. depend on the position of the touch
|
||
|
screen relative to the monitor). The values determine where the points (0,0)
|
||
|
and (xmax,ymax) on your monitor (xmax and ymax depend on the resolution
|
||
|
chosen for the Xserver, such as 1024x768) are mapped on the touch screen.
|
||
|
The device driver reads these values and interpolishes the other coordinates.
|
||
|
For illustration:
|
||
|
</p>
|
||
|
|
||
|
<p><verb>
|
||
|
--------------touch screen area-----------------
|
||
|
I I
|
||
|
I ########visible monitor area############## I
|
||
|
I #x # I
|
||
|
I # (0,0) # I
|
||
|
I # (MinimumXPosition,MinimumYPosition) # I
|
||
|
I # # I
|
||
|
I # # I
|
||
|
I # # I
|
||
|
I # # I
|
||
|
I # # I
|
||
|
I # # I
|
||
|
I # # I
|
||
|
I # (MaximumXPosition,MaximumYPosition)# I
|
||
|
I # (xmax,ymax)# I
|
||
|
I # x# I
|
||
|
I ########################################## I
|
||
|
I I
|
||
|
------------------------------------------------
|
||
|
</verb></p>
|
||
|
|
||
|
<p>
|
||
|
This mapping can be done by trial and error or by reading the raw output
|
||
|
of the device (needs some serial port programming, see "The Linux Serial
|
||
|
Programming HOWTO"). For the types EloTouch and MicroTouch exists a
|
||
|
rudimentary calibration tool (written by the author of this document,
|
||
|
it can be found at
|
||
|
<url
|
||
|
url="ftp://metalab.unc.edu/pub/linux/X11/xutils/touchcal-0.1.tar.gz"
|
||
|
name="ftp://metalab.unc.edu/pub/linux/X11/xutils/touchcal-0.1.tar.gz">).
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<sect>Activating the device
|
||
|
<p>
|
||
|
After starting X, type in an Xterminal the command
|
||
|
<p><tt>xsetpointer <devicename></tt></p>
|
||
|
<p>
|
||
|
where<tt><devicename></tt> is the name defined in XF86Config
|
||
|
with the line
|
||
|
<tt>DeviceName "....."</tt>, in this example it would be TouchScreen.
|
||
|
</p>
|
||
|
|
||
|
<sect>Suggested reading
|
||
|
<p>
|
||
|
<itemize>
|
||
|
<item>Manpage for XF86Config
|
||
|
<item><url url="http://www.elotouch.com/linux.html" name="http://www.elotouch.com/linux.html">
|
||
|
<item>The manual shipped with your touch screen :-)
|
||
|
</itemize>
|
||
|
</article>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|