From f436cf920080447481949ce289afbf556e83180f Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Wed, 25 Aug 2021 22:21:32 -0600 Subject: [PATCH] newer touchscreen driver interprets orientation differently --- src/sysinput.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sysinput.c b/src/sysinput.c index dbecb5b..029db06 100644 --- a/src/sysinput.c +++ b/src/sysinput.c @@ -150,12 +150,12 @@ static BOOL poll_touchscreen(void) break; case EV_ABS: - /* Note that the touchscreen driver assumes the screen is "vertical," so swap the x and y axes */ - /* Also it thinks origin is lower left with up = +y */ + /* The screen driver thinks the screen is horizontal with origin at lower left and max at upper right. */ + /* Remap coordinates so origin is at upper left and max is lower right. */ 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; + else if (buffer[i].code == ABS_Y) + touch_y = Fb_Info->height - buffer[i].value; break; case EV_KEY: