From 8ce31e5a4c7d21e47dd6927ddeba4c544a1d50f1 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Wed, 9 Aug 2023 20:50:02 -0600 Subject: [PATCH] input: fix double press issue when assigning a bind (#2895) --- game/system/hid/devices/keyboard.cpp | 2 -- game/system/hid/input_manager.cpp | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/game/system/hid/devices/keyboard.cpp b/game/system/hid/devices/keyboard.cpp index ebe134b315..0e5188da86 100644 --- a/game/system/hid/devices/keyboard.cpp +++ b/game/system/hid/devices/keyboard.cpp @@ -122,8 +122,6 @@ void KeyboardDevice::process_event(const SDL_Event& event, // modifiers are instead inspected on a KEYUP, however if it's one of the keys // for triggering the binding assignment, and it's the first time we've seen it -- we ignore // it - // TODO - `seen_confirm_up` should already be true if they didn't press that key - // this is preventing setting modifiers as keys if (!bind_assignment->seen_confirm_up) { for (const auto& confirm_bind : bind_assignment->keyboard_confirmation_binds) { if (confirm_bind.sdl_idx == key_event.keysym.sym) { diff --git a/game/system/hid/input_manager.cpp b/game/system/hid/input_manager.cpp index 9e30c8f693..589a3dd217 100644 --- a/game/system/hid/input_manager.cpp +++ b/game/system/hid/input_manager.cpp @@ -435,8 +435,7 @@ void InputManager::set_wait_for_bind(const InputDeviceType device_type, m_waiting_for_bind->keyboard_confirmation_binds = m_settings->keyboard_binds.lookup_button_binds(PadData::CROSS); if (g_game_version == GameVersion::Jak1) { - auto& circle_binds = m_waiting_for_bind->keyboard_confirmation_binds = - m_settings->keyboard_binds.lookup_button_binds(PadData::CIRCLE); + auto circle_binds = m_settings->keyboard_binds.lookup_button_binds(PadData::CIRCLE); m_waiting_for_bind->keyboard_confirmation_binds.insert( m_waiting_for_bind->keyboard_confirmation_binds.end(), circle_binds.begin(), circle_binds.end());