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