From 9fcc98a60a1236ffde3f8e5af1966beb09de6206 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 4 Jul 2024 21:40:32 +1000 Subject: [PATCH] InputSource: Explicitly construct binding key --- src/util/dinput_source.cpp | 7 ++++--- src/util/sdl_input_source.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/util/dinput_source.cpp b/src/util/dinput_source.cpp index f92a5d851..960caf591 100644 --- a/src/util/dinput_source.cpp +++ b/src/util/dinput_source.cpp @@ -165,8 +165,9 @@ void DInputSource::Shutdown() while (!m_controllers.empty()) { const u32 index = static_cast(m_controllers.size() - 1); - InputManager::OnInputDeviceDisconnected({{.source_type = InputSourceType::DInput, .source_index = index}}, - GetDeviceIdentifier(static_cast(m_controllers.size() - 1))); + InputManager::OnInputDeviceDisconnected( + InputBindingKey{{.source_type = InputSourceType::DInput, .source_index = index}}, + GetDeviceIdentifier(static_cast(m_controllers.size() - 1))); m_controllers.pop_back(); } } @@ -270,7 +271,7 @@ void DInputSource::PollEvents() if (hr != DI_OK) { InputManager::OnInputDeviceDisconnected( - {{.source_type = InputSourceType::DInput, .source_index = static_cast(i)}}, + InputBindingKey{{.source_type = InputSourceType::DInput, .source_index = static_cast(i)}}, GetDeviceIdentifier(static_cast(i))); m_controllers.erase(m_controllers.begin() + i); continue; diff --git a/src/util/sdl_input_source.cpp b/src/util/sdl_input_source.cpp index cb0260252..b1d1c9e88 100644 --- a/src/util/sdl_input_source.cpp +++ b/src/util/sdl_input_source.cpp @@ -822,7 +822,7 @@ bool SDLInputSource::CloseDevice(int joystick_index) return false; InputManager::OnInputDeviceDisconnected( - {{.source_type = InputSourceType::SDL, .source_index = static_cast(it->player_id)}}, + InputBindingKey{{.source_type = InputSourceType::SDL, .source_index = static_cast(it->player_id)}}, fmt::format("SDL-{}", it->player_id)); if (it->haptic)