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.
This commit is contained in:
Jonas Kölker
2015-09-22 11:37:17 +02:00
committed by Simon Tatham
parent d64a79e2b8
commit bf8ff09a84
2 changed files with 10 additions and 4 deletions

View File

@ -2024,10 +2024,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
if (!ui->cursor_active) { if (!ui->cursor_active) {
ui->cursor_active = TRUE; ui->cursor_active = TRUE;
} else if (control | shift) { } else if (control | shift) {
char *move;
if (ui->ndragcoords > 0) return NULL; if (ui->ndragcoords > 0) return NULL;
ui->ndragcoords = -1; 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); KEY_DIRECTION(button), control, tmpbuf);
if (control && !shift && *move)
move_cursor(button, &ui->curx, &ui->cury, w, h, FALSE);
return move;
} else { } else {
move_cursor(button, &ui->curx, &ui->cury, w, h, FALSE); move_cursor(button, &ui->curx, &ui->cury, w, h, FALSE);
if (ui->ndragcoords >= 0) if (ui->ndragcoords >= 0)

View 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 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 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 cancel the drag. Or, hold Control while dragging with the cursor keys
left or right click, respectively, on the edge in the given direction to toggle segments as you move between squares.
relative to the cursor, i.e. to draw a segment or a cross.
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.) (All the actions described in \k{common-actions} are also available.)