chiark / gitweb /
Change Pearl's cursor logic.
authorJonas Kölker <jonaskoelker@yahoo.com>
Tue, 22 Sep 2015 09:37:17 +0000 (11:37 +0200)
committerSimon Tatham <anakin@pobox.com>
Sat, 3 Oct 2015 15:59:04 +0000 (16:59 +0100)
Keyboard dragging while holding Control now moves the cursor to the
target square. Shift-Control-arrowkey performs the previous behavior
of Control-arrowkey.

pearl.c
puzzles.but

diff --git a/pearl.c b/pearl.c
index ff1296449f56b9673da1a299a09b9a9916182a3e..43afcd6cfb7aea415ac22e59d2bf074938ec5806 100644 (file)
--- a/pearl.c
+++ b/pearl.c
@@ -2024,10 +2024,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
        if (!ui->cursor_active) {
            ui->cursor_active = TRUE;
        } else if (control | shift) {
+           char *move;
            if (ui->ndragcoords > 0) return NULL;
            ui->ndragcoords = -1;
-           return mark_in_direction(state, ui->curx, ui->cury,
+           move = mark_in_direction(state, ui->curx, ui->cury,
                                     KEY_DIRECTION(button), control, tmpbuf);
+           if (control && !shift && *move)
+               move_cursor(button, &ui->curx, &ui->cury, w, h, FALSE);
+           return move;
        } else {
            move_cursor(button, &ui->curx, &ui->cury, w, h, FALSE);
            if (ui->ndragcoords >= 0)
index 65782af8145c8b4d252f15ab8c411cc48e78dd8b..4ab0d0b5442f322c341adf5091b58a0385967ec1 100644 (file)
@@ -2990,9 +2990,11 @@ turns, you might mark the one way it \e{can't} go with a cross.)
 
 Alternatively, use the cursor keys to move the cursor.  Use the Enter
 key to begin and end keyboard `drag' operations.  Use the Space key to
-cancel the drag.  Use Ctrl-arrowkey and Shift-arrowkey to simulate a
-left or right click, respectively, on the edge in the given direction
-relative to the cursor, i.e. to draw a segment or a cross.
+cancel the drag.  Or, hold Control while dragging with the cursor keys
+to toggle segments as you move between squares.
+
+Pressing Control-Shift-arrowkey or Shift-arrowkey simulates a left or
+right click, respectively, on the edge in the direction of the key.
 
 (All the actions described in \k{common-actions} are also available.)