+ if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+ {
+ if (game_status == GAME_MODE_PLAYING)
+ {
+ // when playing MM style levels, also use delay for keyboard events
+ joytest |= keyboard;
+
+ // only use first delay value for new events, but not for changed events
+ use_delay_value_first = (!joytest != !joytest_last);
+
+ // only use delay after the initial keyboard event
+ delay_value = 0;
+ }
+
+ // for any joystick or keyboard event, enable playfield tile cursor
+ if (dx || dy || button)
+ SetTileCursorEnabled(TRUE);
+ }
+
+ if (joytest && !button && !DelayReached(&joytest_delay, joytest_delay_value))
+ {
+ /* delay joystick/keyboard actions if axes/keys continually pressed */
+ newbutton = dx = dy = 0;
+ }
+ else
+ {
+ /* first start with longer delay, then continue with shorter delay */
+ joytest_delay_value =
+ (use_delay_value_first ? delay_value_first : delay_value);
+ }
+
+ joytest_last = joytest;
+