+ ui->displaysel = 0;
+
+ if (button == RIGHT_BUTTON || button == LEFT_BUTTON) {
+ tx = FROMCOORD(x); ty= FROMCOORD(y);
+ } else if (button == CURSOR_UP || button == CURSOR_DOWN ||
+ button == CURSOR_LEFT || button == CURSOR_RIGHT) {
+ int dx = 0, dy = 0;
+ ui->displaysel = 1;
+ dx = (button == CURSOR_LEFT) ? -1 : ((button == CURSOR_RIGHT) ? +1 : 0);
+ dy = (button == CURSOR_DOWN) ? +1 : ((button == CURSOR_UP) ? -1 : 0);
+ ui->xsel = (ui->xsel + from->params.w + dx) % from->params.w;
+ ui->ysel = (ui->ysel + from->params.h + dy) % from->params.h;
+ debug(("cursor pressed, d=(%d,%d), sel=(%d,%d)",dx,dy,ui->xsel,ui->ysel));
+ return ret;
+ } else if (button == CURSOR_SELECT || button == ' ' || button == '\r' ||
+ button == '\n') {
+ ui->displaysel = 1;
+ tx = ui->xsel;
+ ty = ui->ysel;
+ debug(("cursor select, t=(%d,%d)", tx, ty));
+ } else