From 10bd3aeb2ac89a22d5ecfec5942db43e684912ec Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Fri, 18 Nov 2022 14:40:56 +0000 Subject: 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. --- pearl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.1