I more or less now have a working tslib based TinyX server now. (note,
there's a bug in current tslib cvs that we haven't checked in a real fix
for yet)
This brings tslib based touchscreen support to TinyX for a variety of
touchscreens, notably the hitachi webpad, and the xscale lubbock. (a few
more are coming out soon - one's a ppc_405 box, and the other is some
sort of generic x86 serial connection).
But.
in simplifying the code I've run into a mental block in how, really,
TinyX should deal with pointer down events for a touch screen.
right now the revised thing in ts.c looks like
void
TsRead (int tsPort, void *closure)
{
KdMouseInfo *mi = closure;
int fd = (int) mi->driver;
#ifdef HAVE_TSLIB
struct ts_sample event;
#else
TS_EVENT event;
#endif
long buf[3];
int n;
long pressure;
long x, y;
unsigned long flags;
unsigned long buttons;
#ifdef HAVE_TSLIB
n = ts_read(tsDev, &event, 1);
if ( n == 1 )
#else
n = TsReadBytes (tsPort, (char *) &event, sizeof (event), sizeof
(event));
if (n == sizeof (event))
#endif
{
fprintf(stderr,"x: %d y: %d pressure: %d n: %d\n", event.x,
event.y, event.pressure,n);
if (event.pressure)
{
flags = KD_BUTTON_1;
} else {
flags = 0;
}
KdEnqueueMouseEvent (mi, flags, event.x, event.y);
}
}
The original code was synthesising mouse movement events which seemed to
me to be unnecessary, so I cut it out. But now tapping on menus and the
like brings no response. So I assume that synthesising the mouse
movement made tapping on such things "just work" - and I'll add that
code back in to see if it works.
But, conceptually, to me, having button 1 down when you touch the screen
in an arbitrary place should "just work". Or should it always pretend it
delta'd in from another place so that entering/leaving areas works?
Is there a paper on touchscreen vs mouse events in X somewhere? Any
light to shed on the issue on this list?
I'll be reviewing how the modular XFree server does things this weekend
and tracing through the KdEnqueueMouseEvent code...
______________
Michael Taht BLOG: http://the-edge.blogspot.com
Member, Visionary Staff MontaVista Software
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert