- ret = in_menu_wait_any(charcode, wait);
- if (ret == inp_prev)
- repeats++;
-
- while (!(ret & interesting)) {
- ret = in_menu_wait_any(charcode, -1);
- release = 1;
- }
-
- if (release || ret != inp_prev)
- repeats = 0;
-
- inp_prev = ret;
+ /* wait until either key repeat or a new key has been pressed */
+#ifdef SDL_REDRAW_EVT
+ interesting |= PBTN_RDRAW;
+#endif
+ do {
+ ret = in_menu_wait_any(charcode, wait);
+ if (ret == 0 || ret != menu_key_prev)
+ menu_key_repeat = 0;
+ else
+ menu_key_repeat++;
+ wait = -1;
+ /* mask away all old keys if an additional new key is pressed */
+ /* XXX what if old and new keys share bits (PBTN_CHAR)? */
+ ret &= ~menu_key_mask;
+ } while (!(ret & interesting));