X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=13723bfa514da9ff8f78e499946907ad7d4729bd;hb=97b1e9813e532b9065a841f2d185d632df19bf7a;hp=1a6ac788b29aab28eca2f5918725cf3aeb09284d;hpb=4de6ecd779b3e482721e8d769cd4ca28f18ab66e;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 1a6ac788..13723bfa 100644 --- a/src/events.c +++ b/src/events.c @@ -108,7 +108,7 @@ static int FilterEvents(const Event *event) { SetMouseCursor(CURSOR_DEFAULT); - DelayReached(&special_cursor_delay, 0); + ResetDelayCounter(&special_cursor_delay); cursor_mode_last = CURSOR_DEFAULT; } @@ -214,6 +214,8 @@ static void HandleEvents(void) while (NextValidEvent(&event)) { + int game_status_last = game_status; + switch (event.type) { case EVENT_BUTTONPRESS: @@ -264,6 +266,10 @@ static void HandleEvents(void) break; } + // always handle events within delay period if game status has changed + if (game_status != game_status_last) + ResetDelayCounter(&event_frame_delay); + // do not handle events for longer than standard frame delay period if (DelayReached(&event_frame_delay, event_frame_delay_value)) break; @@ -330,7 +336,7 @@ static void HandleMouseCursor(void) // display normal pointer if mouse pressed if (button_status != MB_RELEASED) - DelayReached(&special_cursor_delay, 0); + ResetDelayCounter(&special_cursor_delay); if (gfx.cursor_mode != CURSOR_PLAYFIELD && cursor_inside_playfield && @@ -1470,7 +1476,7 @@ void HandleKeyEvent(KeyEvent *event) if (key_status == KEY_PRESSED) SetOverlayEnabled(!GetOverlayEnabled()); } - else + else if (!textinput_status) { // for any other "real" key event, disable virtual buttons SetOverlayEnabled(FALSE); @@ -2085,6 +2091,8 @@ void HandleKey(Key key, int key_status) { key_action |= key_info[i].action | JOY_BUTTON_SNAP; key_snap_action |= key_info[i].action; + + tape.property_bits |= TAPE_PROPERTY_TAS_KEYS; } } } @@ -2405,7 +2413,7 @@ void HandleKey(Key key, int key_status) switch (key) { case KSYM_Escape: - RequestQuitGame(setup.ask_on_escape); + RequestQuitGame(TRUE); break; default: