Jonas Koelker points out that the backspace key didn't work in GTK
[sgt/puzzles] / unequal.c
index c9d2c60..35837c0 100644 (file)
--- a/unequal.c
+++ b/unequal.c
@@ -392,7 +392,7 @@ static char n2c(digit n, int order) {
 static int c2n(int c, int order) {
     if (c < 0 || c > 0xff)
         return -1;
-    if (c == ' ' || c == '\010' || c == '\177')
+    if (c == ' ' || c == '\b')
         return 0;
     if (order < 10) {
         if (c >= '1' && c <= '9')
@@ -1299,10 +1299,6 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
             return "";
         }
     }
-    if (button == 'H' || button == 'h')
-        return dupstr("H");
-    if (button == 'M' || button == 'm')
-        return dupstr("M");
 
     if (IS_CURSOR_MOVE(button)) {
         move_cursor(button, &ui->hx, &ui->hy, ds->order, ds->order, 0);
@@ -1340,6 +1336,12 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
 
         return dupstr(buf);
     }
+
+    if (button == 'H' || button == 'h')
+        return dupstr("H");
+    if (button == 'M' || button == 'm')
+        return dupstr("M");
+
     return NULL;
 }