pearl: Return NULL when Backspace or Escape does nothing

When there's no drag in progress, cancelling the drag has no effect.
Returning NULL lets the front-end know this, which in particular means
the Backspace key can leave the app in KaiOS.
This commit is contained in:
Ben Harris
2022-11-18 14:40:56 +00:00
parent 51b496e118
commit 10bd3aeb2a

View File

@ -2135,7 +2135,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
} }
} }
if (button == 27 || button == '\b') { if ((button == 27 || button == '\b') && ui->ndragcoords >= 0) {
ui->ndragcoords = -1; ui->ndragcoords = -1;
return UI_UPDATE; return UI_UPDATE;
} }