chiark / gitweb /
Make peg removal accessible from the keyboard.
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Tue, 28 Jun 2005 18:10:20 +0000 (18:10 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Tue, 28 Jun 2005 18:10:20 +0000 (18:10 +0000)
[originally from svn r6032]

guess.c
puzzles.but

diff --git a/guess.c b/guess.c
index 7e51642a487de53a719d81fb7819f570085800fa..a871e72326e63c87184c22d3715cc1c27c5176f3 100644 (file)
--- a/guess.c
+++ b/guess.c
@@ -714,6 +714,10 @@ static char *interpret_move(game_state *from, game_ui *ui, game_drawstate *ds,
             set_peg(&from->params, ui, ui->peg_cur, ui->colour_cur+1);
             ret = "";
         }
+    } else if (button == 'D' || button == 'd' || button == '\b') {
+        ui->display_cur = 1;
+        set_peg(&from->params, ui, ui->peg_cur, 0);
+        ret = "";
     } else if (button == 'H' || button == 'h') {
         ui->display_cur = 1;
         ui->holds[ui->peg_cur] = 1 - ui->holds[ui->peg_cur];
index 9d673611f432041429cefc7f07de6b1151343fa9..71ff48fb1ab09bb89dc1813468dc59b145b4f5f9 100644 (file)
@@ -1077,7 +1077,8 @@ after marking.
 Alternatively, with the keyboard, the up and down cursor keys can be
 used to select a peg colour, the left and right keys to select a
 peg position, and the space bar or Enter key to place a peg of the
-selected colour in the chosen position. \q{H} adds a hold marker.
+selected colour in the chosen position. \q{D} or Backspace removes a
+peg, and \q{H} adds a hold marker.
 
 When the guess is complete, the smaller feedback pegs will be highlighted;
 clicking on these (or moving the peg cursor to them with the arrow keys