summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/palisade.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/puzzles/src/palisade.c')
-rw-r--r--apps/plugins/puzzles/src/palisade.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/apps/plugins/puzzles/src/palisade.c b/apps/plugins/puzzles/src/palisade.c
index 5227a1d56c..e495bbed2c 100644
--- a/apps/plugins/puzzles/src/palisade.c
+++ b/apps/plugins/puzzles/src/palisade.c
@@ -865,14 +865,16 @@ static char *game_text_format(const game_state *state)
865 865
866struct game_ui { 866struct game_ui {
867 int x, y; 867 int x, y;
868 unsigned int show: 1; 868 unsigned int show: 1;
869 unsigned int fake_ctrl: 1;
870 unsigned int fake_shift: 1;
869}; 871};
870 872
871static game_ui *new_ui(const game_state *state) 873static game_ui *new_ui(const game_state *state)
872{ 874{
873 game_ui *ui = snew(game_ui); 875 game_ui *ui = snew(game_ui);
874 ui->x = ui->y = 0; 876 ui->x = ui->y = 0;
875 ui->show = FALSE; 877 ui->show = ui->fake_ctrl = ui->fake_shift = FALSE;
876 return ui; 878 return ui;
877} 879}
878 880
@@ -916,7 +918,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
916 const game_drawstate *ds, int x, int y, int button) 918 const game_drawstate *ds, int x, int y, int button)
917{ 919{
918 int w = state->shared->params.w, h = state->shared->params.h; 920 int w = state->shared->params.w, h = state->shared->params.h;
919 int control = button & MOD_CTRL, shift = button & MOD_SHFT; 921 int control = (button & MOD_CTRL) | ui->fake_ctrl, shift = (button & MOD_SHFT) | ui->fake_shift;
922
923 /* reset */
924 ui->fake_ctrl = ui->fake_shift = FALSE;
920 925
921 button &= ~MOD_MASK; 926 button &= ~MOD_MASK;
922 927
@@ -999,6 +1004,16 @@ static char *interpret_move(const game_state *state, game_ui *ui,
999 return UI_UPDATE; 1004 return UI_UPDATE;
1000 } 1005 }
1001 } 1006 }
1007 else if(IS_CURSOR_SELECT(button)) {
1008 /* CURSOR_SELECT or CURSOR_SELECT2 tells us to toggle whether
1009 * the button press should be interpreted as having CTRL or
1010 * shift pressed along with it, respectively. */
1011 ui->show = TRUE;
1012 if(button == CURSOR_SELECT2)
1013 ui->fake_shift = !ui->fake_shift;
1014 else
1015 ui->fake_ctrl = !ui->fake_ctrl;
1016 }
1002 1017
1003 return NULL; 1018 return NULL;
1004} 1019}