flagsbased-uncover
Felix Pankratz 2 years ago
parent 69d2ef1620
commit 7e56f353d8

@ -311,7 +311,7 @@ int32_t minesweeper_app(void* p) {
if(event_status == FuriStatusOk) { if(event_status == FuriStatusOk) {
// press events // press events
if(event.type == EventTypeKey) { if(event.type == EventTypeKey) {
if(event.input.type == InputTypePress) { if(event.input.type == InputTypeShort) {
switch(event.input.key) { switch(event.input.key) {
case InputKeyUp: case InputKeyUp:
minesweeper_state->cursor_y--; minesweeper_state->cursor_y--;
@ -354,6 +354,7 @@ int32_t minesweeper_app(void* p) {
} }
} else if (event.input.type == InputTypeLong) { } else if (event.input.type == InputTypeLong) {
// hold events // hold events
FURI_LOG_D("Minesweeper", "Got a long press!");
switch(event.input.key) { switch(event.input.key) {
case InputKeyUp: case InputKeyUp:
case InputKeyDown: case InputKeyDown:
@ -361,6 +362,7 @@ int32_t minesweeper_app(void* p) {
case InputKeyLeft: case InputKeyLeft:
break; break;
case InputKeyOk: case InputKeyOk:
FURI_LOG_D("Minesweeper", "Toggling flag");
place_flag(minesweeper_state); place_flag(minesweeper_state);
break; break;
case InputKeyBack: case InputKeyBack:
@ -370,8 +372,8 @@ int32_t minesweeper_app(void* p) {
} }
} }
} else { } else {
FURI_LOG_D("Minesweeper", "FuriMessageQueue: event timeout");
// event timeout // event timeout
;
} }
view_port_update(view_port); view_port_update(view_port);
release_mutex(&state_mutex, minesweeper_state); release_mutex(&state_mutex, minesweeper_state);

Loading…
Cancel
Save