int gp2x_touchpad_read(int *x, int *y)\r
{\r
UCB1X00_TS_EVENT event;\r
+ static int zero_seen = 0;\r
int retval;\r
\r
if (touchdev < 0) return -1;\r
printf("touch read failed %i %i\n", retval, errno);\r
return -1;\r
}\r
+ // this is to ignore the messed-up 4.1.x driver\r
+ if (retval == 0) zero_seen = 1;\r
\r
if (x) *x = (event.x * touchcal[0] + touchcal[2]) >> 16;\r
if (y) *y = (event.y * touchcal[4] + touchcal[5]) >> 16;\r
// printf("read %i %i %i\n", event.pressure, *x, *y);\r
\r
- return event.pressure;\r
+ return zero_seen ? event.pressure : 0;\r
}\r
\r
\r