Skip to content

Commit b110f4e

Browse files
committed
Fix: require long press to restart
1 parent dca2363 commit b110f4e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

applications/game2048/game_2048.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ int32_t game_2048_app(void* p) {
391391
GameState* game_state = (GameState*)acquire_mutex_block(&state_mutex);
392392

393393
if(event_status == FuriStatusOk) {
394-
if(event.type == InputTypePress) {
394+
if(event.type == InputTypeShort) {
395395
switch(event.key) {
396396
case InputKeyUp:
397397
game_state->direction = DirectionUp;
@@ -415,12 +415,16 @@ int32_t game_2048_app(void* p) {
415415
break;
416416
case InputKeyOk:
417417
game_state->direction = DirectionIdle;
418-
game_2048_restart(game_state);
419418
break;
420419
case InputKeyBack:
421420
loop = false;
422421
break;
423422
}
423+
} else if(event.type == InputTypeLong) {
424+
if(event.key == InputKeyOk) {
425+
game_state->direction = DirectionIdle;
426+
game_2048_restart(game_state);
427+
}
424428
}
425429
}
426430

0 commit comments

Comments
 (0)