+ } else if (IS_CURSOR_MOVE(button)) {
+ ui->cur_visible = 1;
+
+ move_cursor(button, &ui->cur_x, &ui->cur_y, 2*w-1, 2*h-1, 0);
+
+ return "";
+ } else if (IS_CURSOR_SELECT(button)) {
+ int d1, d2;
+
+ if (!((ui->cur_x ^ ui->cur_y) & 1))
+ return NULL; /* must have exactly one dimension odd */
+ d1 = (ui->cur_y / 2) * w + (ui->cur_x / 2);
+ d2 = ((ui->cur_y+1) / 2) * w + ((ui->cur_x+1) / 2);
+
+ /*
+ * We can't mark an edge next to any domino.
+ */
+ if (button == CURSOR_SELECT2 &&
+ (state->grid[d1] != d1 || state->grid[d2] != d2))
+ return NULL;
+
+ sprintf(buf, "%c%d,%d", (int)(button == CURSOR_SELECT2 ? 'E' : 'D'), d1, d2);
+ return dupstr(buf);