X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=platform%2Fgp2x%2Fgp2x.c;h=80b0486c65fbbfdfade08ef3253749ad9ba4217d;hb=f0f0d2df762a7fbbf8d4d9359d541621837ed067;hp=78e8561f857034c6a6bf16d7876238bfd3e4d2d9;hpb=916363c86de4fc4f560b9cf3463c0a379bee5eed;p=picodrive.git diff --git a/platform/gp2x/gp2x.c b/platform/gp2x/gp2x.c index 78e8561..80b0486 100644 --- a/platform/gp2x/gp2x.c +++ b/platform/gp2x/gp2x.c @@ -231,6 +231,7 @@ typedef struct ucb1x00_ts_event int gp2x_touchpad_read(int *x, int *y) { UCB1X00_TS_EVENT event; + static int zero_seen = 0; int retval; if (touchdev < 0) return -1; @@ -240,12 +241,14 @@ int gp2x_touchpad_read(int *x, int *y) 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 (x) *x = (event.x * touchcal[0] + touchcal[2]) >> 16; if (y) *y = (event.y * touchcal[4] + touchcal[5]) >> 16; // printf("read %i %i %i\n", event.pressure, *x, *y); - return event.pressure; + return zero_seen ? event.pressure : 0; }