From: doel@ausable.crd.ge.com (Michael Doel)
Newsgroups: comp.windows.x
Subject: Re: Touchscreens and Multple Pointer Devices
Keywords: touch pointer
Date: 23 Jul 92 21:06:36 GMT
Reply-To: doel@crd.ge.com
Organization: GE Research & Development

In article <5720@taurus.cs.nps.navy.mil>, hebo@hp850.mbari.org (Bob Herlien) writes:
> I want to add a touchscreen to some X terminals for a control/display app
> I'm developing, and I have some general questions about how they're integrated
> into an X environment.

your problems sound very similar to the ones we are looking into


> The touchscreen vendor I've located stated that X11R4 uses only a single
> pointing device, but that X11R5 can have multiple ones.  How does this work?
> Are there multiple mouseforms on the screen?  Are they both generating
> events?  In Motif (1.2, I assume), can events from either device trigger
> callbacks (arm, activate, etc)?

Not having spoke to your vendor, I can only assume that you were a bit
misled.  As I understand it, X11Rn (for all n) will only allow one pointing
device.  To allow more than one would require a relatively large change
to the X protocol (hence X12R1 ?).  In particular, the event structure would
need to include a field to indicate which pointing device generated the
event.  You can't just add this to X11R5 and still have X11R4 apps working
correctly.

There is a bit of hope however.  I was told by someone (I can't remember
who unfortunately) that they were able to write a device driver which
controls more than one physical device.  Since there is only one driver
though, it looks like one logical device to the X Server.  This may be
acceptable in your application since you will really only be using one
of the devices at a time.  For us however, no luck (we need multiple
logical devices in addition to multiple physical devices).

I have to admit to being quite surprised when I learned of this restriction
in X.  Can anyone enlighten us as to why the restriction exists?  Is it
much more complicated than simply putting extra information in some of the
protocol messages & having the X server keep an array of pointers instead
of just one?  With all of the flexibility already in X, I would have thought
multiple logical pointers would have been included long ago.


> Finally, since a touchscreen doesn't have buttons, how does one distinguish
> between motion and button events using a touchscreen?

Usually, touching the screen (often triggered by breaking a light beam) is
the same as a mouse button press at that location.  As you move your finger
around, you'd be generating motion events.  When you finally pull your
finger away from the screen, you'd have a ButtonReleased event. 

Please summarize any info you get on the subject after awhile.  Like I
said, we're faced with the same problem & I think we may be forced into
writing extensions to the X protocol (requiring additions to the MIT
sample server, Xlib, Xt, etc).

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mike Doel				<doel@crd.ge.com>
P.O. Box 8
Schenectady, NY 12301			(518) 387-6203

"For every complex problem, there is a solution that is simple, neat
 and wrong." - H.L. Mencken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~