aboutsummaryrefslogtreecommitdiff
path: root/pearl.c
diff options
context:
space:
mode:
authorJonas Kölker <jonaskoelker@yahoo.com>2015-09-22 11:37:17 +0200
committerSimon Tatham <anakin@pobox.com>2015-10-03 16:59:04 +0100
commitbf8ff09a84c129f0e3e66e18df61912871d4b6e3 (patch)
tree291520b0be2b3094dc2b40a68526cd3b182832a7 /pearl.c
parentd64a79e2b83f0bfe98c74763a1e42daeb0b3d952 (diff)
downloadpuzzles-bf8ff09a84c129f0e3e66e18df61912871d4b6e3.zip
puzzles-bf8ff09a84c129f0e3e66e18df61912871d4b6e3.tar.gz
puzzles-bf8ff09a84c129f0e3e66e18df61912871d4b6e3.tar.bz2
puzzles-bf8ff09a84c129f0e3e66e18df61912871d4b6e3.tar.xz
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.
Diffstat (limited to 'pearl.c')
-rw-r--r--pearl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pearl.c b/pearl.c
index ff12964..43afcd6 100644
--- 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)