X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Fgp2x.c;h=56fbf5cde9a2343da28504fd8ef32a5aa2ac906b;hb=f11bad75edc8966e9f84b040163cc86e830c46c6;hp=80b0486c65fbbfdfade08ef3253749ad9ba4217d;hpb=6589c840ca686751d15ebb127367af1378dd7de2;p=libpicofe.git diff --git a/gp2x/gp2x.c b/gp2x/gp2x.c index 80b0486..56fbf5c 100644 --- a/gp2x/gp2x.c +++ b/gp2x/gp2x.c @@ -237,12 +237,12 @@ int gp2x_touchpad_read(int *x, int *y) if (touchdev < 0) return -1; retval = read(touchdev, &event, sizeof(event)); - if (retval < 0) { + if (retval <= 0) { printf("touch read failed %i %i\n", retval, errno); return -1; } // this is to ignore the messed-up 4.1.x driver - if (retval == 0) zero_seen = 1; + if (event.pressure == 0) zero_seen = 1; if (x) *x = (event.x * touchcal[0] + touchcal[2]) >> 16; if (y) *y = (event.y * touchcal[4] + touchcal[5]) >> 16;