shithub: puzzles

Download patch

ref: 10bd3aeb2ac89a22d5ecfec5942db43e684912ec
parent: 51b496e1183baceeaee8679e922a290dc51f8207
author: Ben Harris <bjh21@bjh21.me.uk>
date: Fri Nov 18 09:40:56 EST 2022

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.

--- a/pearl.c
+++ b/pearl.c
@@ -2135,7 +2135,7 @@
 	}
     }
 
-    if (button == 27 || button == '\b') {
+    if ((button == 27 || button == '\b') && ui->ndragcoords >= 0) {
         ui->ndragcoords = -1;
         return UI_UPDATE;
     }