+ if (IS_CURSOR_MOVE(button)) {
+ move_cursor(button, &ui->cx, &ui->cy, w, h, 0);
+ ui->cdisp = 1;
+ return "";
+ }
+ if (ui->cdisp) {
+ char rep = 0;
+ int v = state->grid[ui->cy*w+ui->cx];
+
+ if (v != TREE) {
+#ifdef SINGLE_CURSOR_SELECT
+ if (button == CURSOR_SELECT)
+ /* SELECT cycles T, N, B */
+ rep = v == BLANK ? 'T' : v == TENT ? 'N' : 'B';
+#else
+ if (button == CURSOR_SELECT)
+ rep = v == BLANK ? 'T' : 'B';
+ else if (button == CURSOR_SELECT2)
+ rep = v == BLANK ? 'N' : 'B';
+ else if (button == 'T' || button == 'N' || button == 'B')
+ rep = (char)button;
+#endif
+ }
+
+ if (rep) {
+ sprintf(tmpbuf, "%c%d,%d", (int)rep, ui->cx, ui->cy);
+ return dupstr(tmpbuf);
+ }
+ } else if (IS_CURSOR_SELECT(button)) {
+ ui->cdisp = 1;
+ return "";
+ }
+