From 46f1fb99d951a2c83347d99063e51aff5375ab57 Mon Sep 17 00:00:00 2001 From: Lephe Date: Sun, 13 Apr 2025 11:38:40 +0200 Subject: [PATCH] touch: name events DOWN/DRAG/UP to match keyboard --- include/gint/keyboard.h | 4 ++-- src/touch/touch.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/gint/keyboard.h b/include/gint/keyboard.h index 47a68a8..40a97f7 100644 --- a/include/gint/keyboard.h +++ b/include/gint/keyboard.h @@ -151,9 +151,9 @@ enum KEYEV_UP = 2, /* Key was released */ KEYEV_HOLD = 3, /* A key that was pressed has been held down */ KEYEV_OSMENU = 4, /* We went to the main menu and back */ - KEYEV_TOUCH_PRESSED = 5, /* Touch was detected */ + KEYEV_TOUCH_DOWN = 5, /* Touch was detected */ KEYEV_TOUCH_DRAG = 6, /* A touch that was detected has been held down */ - KEYEV_TOUCH_RELEASE = 7, /* Touch was released */ + KEYEV_TOUCH_UP = 7, /* Touch was released */ }; /* Keyboard frequency analysis is a runtime setting since gint 2.4. This macro diff --git a/src/touch/touch.c b/src/touch/touch.c index 51fb315..a5512d8 100644 --- a/src/touch/touch.c +++ b/src/touch/touch.c @@ -190,12 +190,12 @@ static key_event_t make_event(struct _touch_addots const *dots) // TODO: Handle dual touch here if(dots->touches != 1) { - if(prev_type != KEYEV_TOUCH_RELEASE && prev_type != KEYEV_NONE) - evt.type = KEYEV_TOUCH_RELEASE; + if(prev_type != KEYEV_TOUCH_UP && prev_type != KEYEV_NONE) + evt.type = KEYEV_TOUCH_UP; } else { - if(prev_type == KEYEV_TOUCH_RELEASE || prev_type == KEYEV_NONE) - evt.type = KEYEV_TOUCH_PRESSED; + if(prev_type == KEYEV_TOUCH_UP || prev_type == KEYEV_NONE) + evt.type = KEYEV_TOUCH_DOWN; /* Don't emit successive DRAG events at the same location */ else if(dots->x1 != prev_x || dots->y1 != prev_y) evt.type = KEYEV_TOUCH_DRAG;