From d1be9460b9c2e76c97fccaaee56773500796afeb Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 27 Oct 2019 21:36:40 +1000 Subject: [PATCH] Frontend: Ignore key repeat events for controller/speed limit --- src/duckstation/sdl_interface.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/duckstation/sdl_interface.cpp b/src/duckstation/sdl_interface.cpp index f222f858e..c0a4dc8b2 100644 --- a/src/duckstation/sdl_interface.cpp +++ b/src/duckstation/sdl_interface.cpp @@ -546,7 +546,8 @@ void SDLInterface::HandleSDLEvent(const SDL_Event* event) void SDLInterface::HandleSDLKeyEvent(const SDL_Event* event) { - if (m_controller && HandleSDLKeyEventForController(event, m_controller.get())) + const bool repeat = event->key.repeat != 0; + if (!repeat && m_controller && HandleSDLKeyEventForController(event, m_controller.get())) return; const bool pressed = (event->type == SDL_KEYDOWN); @@ -574,8 +575,11 @@ void SDLInterface::HandleSDLKeyEvent(const SDL_Event* event) case SDL_SCANCODE_TAB: { - m_speed_limiter_temp_disabled = pressed; - UpdateAudioVisualSync(); + if (!repeat) + { + m_speed_limiter_temp_disabled = pressed; + UpdateAudioVisualSync(); + } } break;