old-www/HOWTO/XFree86-Touch-Screen-HOWTO-...

102 lines
3.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
<TITLE>Linux Touch Screen HOWTO: How to configure the device</TITLE>
<LINK HREF="XFree86-Touch-Screen-HOWTO-2.html" REL=next>
<LINK HREF="XFree86-Touch-Screen-HOWTO.html#toc1" REL=contents>
</HEAD>
<BODY>
<A HREF="XFree86-Touch-Screen-HOWTO-2.html">Next</A>
Previous
<A HREF="XFree86-Touch-Screen-HOWTO.html#toc1">Contents</A>
<HR>
<H2><A NAME="s1">1.</A> <A HREF="XFree86-Touch-Screen-HOWTO.html#toc1">How to configure the device</A></H2>
<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>
<PRE>
Section "Files"
...
ModulePath "/usr/X11R6/lib/modules"
...
EndSection
</PRE>
</P>
<P>To get the module loaded by the X server there has to be a section like this:</P>
<P>
<PRE>
Section "Module"
Load "xf86Elo.so"
EndSection
</PRE>
</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>
<PRE>
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
AlwaysCore #activates the device on startup
EndSubSection
EndSection
</PRE>
</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>
<PRE>
--------------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
------------------------------------------------
</PRE>
</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
<A HREF="http://touchcal.sourceforge.net">http://touchcal.sourceforge.net</A>).</P>
<HR>
<A HREF="XFree86-Touch-Screen-HOWTO-2.html">Next</A>
Previous
<A HREF="XFree86-Touch-Screen-HOWTO.html#toc1">Contents</A>
</BODY>
</HTML>