X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=42277b02e6c1947d5e0176b11657638aa68a7e49;hb=686d4883428879e2e882222a6579e376d9e4ac4c;hp=b2bf0979495a2b8e139f49bd043c5cfef18641e3;hpb=db8186256826b3a86f03fc482a240523d3f3f65b;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index b2bf0979..42277b02 100644 --- a/src/events.c +++ b/src/events.c @@ -108,9 +108,8 @@ boolean SkipPressedMouseMotionEvent(const Event *event) if (event->type != EVENT_MOTIONNOTIFY) return FALSE; - /* only skip motion events with pressed button outside level editor */ - if (button_status == MB_RELEASED || - game_status == GAME_MODE_EDITOR || game_status == GAME_MODE_PLAYING) + /* only skip motion events with pressed button outside the game */ + if (button_status == MB_RELEASED || game_status == GAME_MODE_PLAYING) return FALSE; if (PendingEvent()) @@ -933,12 +932,14 @@ void HandleWindowManagerEvent(Event *event) void HandleButton(int mx, int my, int button, int button_nr) { static int old_mx = 0, old_my = 0; + boolean button_hold = FALSE; if (button < 0) { mx = old_mx; my = old_my; button = -button; + button_hold = TRUE; } else { @@ -947,6 +948,7 @@ void HandleButton(int mx, int my, int button, int button_nr) } #if defined(PLATFORM_ANDROID) + // !!! for now, do not handle gadgets when playing -- maybe fix this !!! if (game_status != GAME_MODE_PLAYING && HandleGadgets(mx, my, button)) { @@ -961,6 +963,9 @@ void HandleButton(int mx, int my, int button, int button_nr) } #endif + if (button_hold && game_status == GAME_MODE_PLAYING && tape.pausing) + return; + /* do not use scroll wheel button events for anything other than gadgets */ if (IS_WHEEL_BUTTON(button_nr)) return; @@ -1596,7 +1601,8 @@ void HandleKey(Key key, int key_status) void HandleNoEvent() { - if (button_status && game_status != GAME_MODE_PLAYING) + // if (button_status && game_status != GAME_MODE_PLAYING) + if (button_status && (game_status != GAME_MODE_PLAYING || tape.pausing)) { HandleButton(0, 0, -button_status, button_status); }