mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00:00
ControllerInterface/Win32: Prevent devcies from losing their "id" on a hotplug event.
This commit is contained in:
parent
d26c1ce24d
commit
eadbdd6bc3
10 changed files with 121 additions and 39 deletions
|
@ -194,6 +194,11 @@ void Device::UpdateMotors()
|
|||
}
|
||||
}
|
||||
|
||||
std::optional<int> Device::GetPreferredId() const
|
||||
{
|
||||
return m_index;
|
||||
}
|
||||
|
||||
// GET name/source/id
|
||||
|
||||
std::string Device::Button::GetName() const
|
||||
|
|
|
@ -92,8 +92,9 @@ public:
|
|||
|
||||
Device(const XINPUT_CAPABILITIES& capabilities, u8 index);
|
||||
|
||||
std::string GetName() const override;
|
||||
std::string GetSource() const override;
|
||||
std::string GetName() const final override;
|
||||
std::string GetSource() const final override;
|
||||
std::optional<int> GetPreferredId() const final override;
|
||||
|
||||
void UpdateMotors();
|
||||
|
||||
|
@ -104,5 +105,5 @@ private:
|
|||
const BYTE m_subtype;
|
||||
const u8 m_index;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace XInput
|
||||
} // namespace ciface
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue