mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-04-15 23:46:58 +02:00
touch: name events DOWN/DRAG/UP to match keyboard
This commit is contained in:
parent
bc8b9863ae
commit
46f1fb99d9
2 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue