- move_cursor(button, &ui->hx, &ui->hy, w, w, 0);
+ int cx = find_in_sequence(state->sequence, w, ui->hx);
+ int cy = find_in_sequence(state->sequence, w, ui->hy);
+ move_cursor(button, &cx, &cy, w, w, 0);
+ ui->hx = state->sequence[cx];
+ ui->hy = state->sequence[cy];