aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-11-18 14:40:56 +0000
committerBen Harris <bjh21@bjh21.me.uk>2022-11-18 14:40:56 +0000
commit10bd3aeb2ac89a22d5ecfec5942db43e684912ec (patch)
tree311c9fd13b308bbd9b48f7331feda52a96086559
parent51b496e1183baceeaee8679e922a290dc51f8207 (diff)
downloadpuzzles-10bd3aeb2ac89a22d5ecfec5942db43e684912ec.zip
puzzles-10bd3aeb2ac89a22d5ecfec5942db43e684912ec.tar.gz
puzzles-10bd3aeb2ac89a22d5ecfec5942db43e684912ec.tar.bz2
puzzles-10bd3aeb2ac89a22d5ecfec5942db43e684912ec.tar.xz
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.
-rw-r--r--pearl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pearl.c b/pearl.c
index e53b4da..27b4860 100644
--- a/pearl.c
+++ b/pearl.c
@@ -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;
return UI_UPDATE;
}