ref: bf8ff09a84c129f0e3e66e18df61912871d4b6e3
parent: d64a79e2b83f0bfe98c74763a1e42daeb0b3d952
author: Jonas Kölker <jonaskoelker@yahoo.com>
date: Tue Sep 22 07:37:17 EDT 2015
Change Pearl's cursor logic. Keyboard dragging while holding Control now moves the cursor to the target square. Shift-Control-arrowkey performs the previous behavior of Control-arrowkey.
--- a/pearl.c
+++ b/pearl.c
@@ -2024,10 +2024,14 @@
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)
--- a/puzzles.but
+++ b/puzzles.but
@@ -2990,9 +2990,11 @@
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.)