Skip to content

Commit

Permalink
fix flag
Browse files Browse the repository at this point in the history
  • Loading branch information
panki27 committed Sep 23, 2022
1 parent 69d2ef1 commit 7e56f35
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions minesweeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ int32_t minesweeper_app(void* p) {
if(event_status == FuriStatusOk) {
// press events
if(event.type == EventTypeKey) {
if(event.input.type == InputTypePress) {
if(event.input.type == InputTypeShort) {
switch(event.input.key) {
case InputKeyUp:
minesweeper_state->cursor_y--;
Expand Down Expand Up @@ -343,8 +343,8 @@ int32_t minesweeper_app(void* p) {
minesweeper_state->game_started = true;
}
play_move(
minesweeper_state,
minesweeper_state->cursor_x,
minesweeper_state,
minesweeper_state->cursor_x,
minesweeper_state->cursor_y);
break;
case InputKeyBack:
Expand All @@ -354,13 +354,15 @@ int32_t minesweeper_app(void* p) {
}
} else if (event.input.type == InputTypeLong) {
// hold events
FURI_LOG_D("Minesweeper", "Got a long press!");
switch(event.input.key) {
case InputKeyUp:
case InputKeyDown:
case InputKeyRight:
case InputKeyLeft:
break;
case InputKeyOk:
FURI_LOG_D("Minesweeper", "Toggling flag");
place_flag(minesweeper_state);
break;
case InputKeyBack:
Expand All @@ -370,8 +372,8 @@ int32_t minesweeper_app(void* p) {
}
}
} else {
FURI_LOG_D("Minesweeper", "FuriMessageQueue: event timeout");
// event timeout
// event timeout
;
}
view_port_update(view_port);
release_mutex(&state_mutex, minesweeper_state);
Expand Down

0 comments on commit 7e56f35

Please sign in to comment.