newer touchscreen driver interprets orientation differently

This commit is contained in:
Amy G. Bowersox 2021-08-25 22:21:32 -06:00
parent e536685f56
commit f436cf9200

View File

@ -150,12 +150,12 @@ static BOOL poll_touchscreen(void)
break; break;
case EV_ABS: case EV_ABS:
/* Note that the touchscreen driver assumes the screen is "vertical," so swap the x and y axes */ /* The screen driver thinks the screen is horizontal with origin at lower left and max at upper right. */
/* Also it thinks origin is lower left with up = +y */ /* Remap coordinates so origin is at upper left and max is lower right. */
if (buffer[i].code == ABS_X) if (buffer[i].code == ABS_X)
touch_y = Fb_Info->height - buffer[i].value;
else if (buffer[i].code == ABS_Y)
touch_x = buffer[i].value; touch_x = buffer[i].value;
else if (buffer[i].code == ABS_Y)
touch_y = Fb_Info->height - buffer[i].value;
break; break;
case EV_KEY: case EV_KEY: