InputSource: Explicitly construct binding key
This commit is contained in:
parent
c02bf0f662
commit
9fcc98a60a
|
@ -165,8 +165,9 @@ void DInputSource::Shutdown()
|
|||
while (!m_controllers.empty())
|
||||
{
|
||||
const u32 index = static_cast<u32>(m_controllers.size() - 1);
|
||||
InputManager::OnInputDeviceDisconnected({{.source_type = InputSourceType::DInput, .source_index = index}},
|
||||
GetDeviceIdentifier(static_cast<u32>(m_controllers.size() - 1)));
|
||||
InputManager::OnInputDeviceDisconnected(
|
||||
InputBindingKey{{.source_type = InputSourceType::DInput, .source_index = index}},
|
||||
GetDeviceIdentifier(static_cast<u32>(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<u32>(i)}},
|
||||
InputBindingKey{{.source_type = InputSourceType::DInput, .source_index = static_cast<u32>(i)}},
|
||||
GetDeviceIdentifier(static_cast<u32>(i)));
|
||||
m_controllers.erase(m_controllers.begin() + i);
|
||||
continue;
|
||||
|
|
|
@ -822,7 +822,7 @@ bool SDLInputSource::CloseDevice(int joystick_index)
|
|||
return false;
|
||||
|
||||
InputManager::OnInputDeviceDisconnected(
|
||||
{{.source_type = InputSourceType::SDL, .source_index = static_cast<u32>(it->player_id)}},
|
||||
InputBindingKey{{.source_type = InputSourceType::SDL, .source_index = static_cast<u32>(it->player_id)}},
|
||||
fmt::format("SDL-{}", it->player_id));
|
||||
|
||||
if (it->haptic)
|
||||
|
|
Loading…
Reference in New Issue