+ if (shift_or_control) {
+ int nx = ui->hx, ny = ui->hy, i, self;
+ move_cursor(button, &nx, &ny, ds->order, ds->order, FALSE);
+ ui->hshow = ui->hcursor = 1;
+
+ for (i = 0; i < 4 && (nx != ui->hx + adjthan[i].dx ||
+ ny != ui->hy + adjthan[i].dy); ++i);
+
+ if (i == 4)
+ return ""; /* invalid direction, i.e. out of the board */
+
+ if (!(GRID(state, flags, ui->hx, ui->hy) & adjthan[i].f ||
+ GRID(state, flags, nx, ny ) & adjthan[i].fo))
+ return ""; /* no clue to toggle */
+
+ if (state->adjacent)
+ self = (adjthan[i].dx >= 0 && adjthan[i].dy >= 0);
+ else
+ self = (GRID(state, flags, ui->hx, ui->hy) & adjthan[i].f);
+
+ if (self)
+ sprintf(buf, "F%d,%d,%d", ui->hx, ui->hy,
+ ADJ_TO_SPENT(adjthan[i].f));
+ else
+ sprintf(buf, "F%d,%d,%d", nx, ny,
+ ADJ_TO_SPENT(adjthan[i].fo));
+
+ return dupstr(buf);
+ } else {
+ move_cursor(button, &ui->hx, &ui->hy, ds->order, ds->order, FALSE);
+ ui->hshow = ui->hcursor = 1;
+ return "";
+ }