X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fevents.c;h=b610ff8b7a05b211daf6393031e0694df00e0a7d;hp=7972d1b53e0ddf37bd1973383675e25b414cd3ae;hb=ad93f89279233a6adfa0dc0ebe3570c4c614cedb;hpb=5eb97ccbaffc671f05dd73bf0548c1666414017e diff --git a/src/events.c b/src/events.c index 7972d1b5..b610ff8b 100644 --- a/src/events.c +++ b/src/events.c @@ -347,6 +347,23 @@ void EventLoop(void) } } +void ClearAutoRepeatKeyEvents() +{ + while (PendingEvent()) + { + Event next_event; + + PeekEvent(&next_event); + + /* if event is repeated key press event, remove it from event queue */ + if (next_event.type == EVENT_KEYPRESS && + next_event.key.repeat) + WaitEvent(&next_event); + else + break; + } +} + void ClearEventQueue() { Event event; @@ -1370,6 +1387,8 @@ static void HandleButtonOrFinger(int mx, int my, int button) HandleButtonOrFinger_WipeGestures_MM(mx, my, button); else if (strEqual(setup.touch.control_type, TOUCH_CONTROL_FOLLOW_FINGER)) HandleButtonOrFinger_FollowFinger_MM(mx, my, button); + else if (strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS)) + SetPlayerMouseAction(mx, my, button); /* special case */ } else { @@ -2222,10 +2241,8 @@ void HandleEventActions() HandleJoystick(); } -#if defined(NETWORK_AVALIABLE) if (network.enabled) HandleNetworking(); -#endif switch (game_status) {