Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

touchscreen: Port yes/no screen to gesture API

Use the gesture API in the yes/no screen to suppress bogus
touches and generally improve reliability.

Change-Id: I44adf95255f07d81188fd249dc00a91519ca7b99

authored by

Aidan MacDonald and committed by
Solomon Peachy
94468f69 67233114

+11 -12
+11 -12
apps/gui/yesno.c
··· 249 249 /* switch to point mode because that's more intuitive */ 250 250 enum touchscreen_mode old_mode = touchscreen_get_mode(); 251 251 touchscreen_set_mode(TOUCHSCREEN_POINT); 252 + action_gesture_reset(); 252 253 #endif 253 254 254 255 /* make sure to eat any extranous keypresses */ ··· 277 278 { 278 279 #ifdef HAVE_TOUCHSCREEN 279 280 case ACTION_TOUCHSCREEN: 281 + { 282 + struct gesture_event gevent; 283 + if (action_gesture_get_event_in_vp(&gevent, &yn[0].vp) && 284 + gevent.id == GESTURE_TAP) 280 285 { 281 - int btn; 282 - short int x, y; 283 - btn = action_get_touchscreen_press_in_vp(&x, &y, &(yn[0].vp)); 284 - if (btn == BUTTON_REL) 286 + if (gevent.y > yn[0].vp.height/2) 285 287 { 286 - if (y > yn[0].vp.height/2) 287 - { 288 - if (x <= yn[0].vp.width/2) 289 - result = YESNO_YES; 290 - else 291 - result = YESNO_NO; 292 - } 288 + if (gevent.x <= yn[0].vp.width/2) 289 + result = YESNO_YES; 290 + else 291 + result = YESNO_NO; 293 292 } 294 293 } 295 - break; 294 + } break; 296 295 #endif 297 296 case ACTION_YESNO_ACCEPT: 298 297 result = YESNO_YES;