aboutsummaryrefslogtreecommitdiff
path: root/towers.c
diff options
context:
space:
mode:
authorJonas Kölker <jonaskoelker@yahoo.com>2015-10-01 18:41:15 +0200
committerSimon Tatham <anakin@pobox.com>2015-10-03 17:12:20 +0100
commit79fe68dc57d72d4765850eb9aec23675523a1a4d (patch)
tree55d4c1710c2f87c70e1cdb7527783663c95eccef /towers.c
parent6179e8df56000bc8f558129a8475cf977c06a249 (diff)
downloadpuzzles-79fe68dc57d72d4765850eb9aec23675523a1a4d.zip
puzzles-79fe68dc57d72d4765850eb9aec23675523a1a4d.tar.gz
puzzles-79fe68dc57d72d4765850eb9aec23675523a1a4d.tar.bz2
puzzles-79fe68dc57d72d4765850eb9aec23675523a1a4d.tar.xz
Towers: allow marking of clues as done with the keyboard
Diffstat (limited to 'towers.c')
-rw-r--r--towers.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/towers.c b/towers.c
index b5092f0..7666af9 100644
--- a/towers.c
+++ b/towers.c
@@ -1292,6 +1292,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
int x, int y, int button)
{
int w = state->par.w;
+ int shift_or_control = button & (MOD_SHFT | MOD_CTRL);
int tx, ty;
char buf[80];
@@ -1376,6 +1377,20 @@ static char *interpret_move(const game_state *state, game_ui *ui,
}
}
if (IS_CURSOR_MOVE(button)) {
+ if (shift_or_control) {
+ int x = ui->hx, y = ui->hy;
+ switch (button) {
+ case CURSOR_LEFT: x = -1; break;
+ case CURSOR_RIGHT: x = w; break;
+ case CURSOR_UP: y = -1; break;
+ case CURSOR_DOWN: y = w; break;
+ }
+ if (is_clue(state, x, y)) {
+ sprintf(buf, "%c%d,%d", 'D', x, y);
+ return dupstr(buf);
+ }
+ return NULL;
+ }
move_cursor(button, &ui->hx, &ui->hy, w, w, 0);
ui->hshow = ui->hcursor = 1;
return "";