ControllerInterface: Implement ChangeWindow on DInput without recreating the devices

Also polished DInput code in general to try and mitigate issue 11702.
Added a lot of logging and comments.
This commit is contained in:
Filoppi
2021-05-15 12:20:20 +03:00
parent dcc345400e
commit a0ecca1a84
8 changed files with 140 additions and 37 deletions

View File

@ -125,6 +125,12 @@ public:
// Currently handled on a per-backend basis but this could change.
virtual bool IsValid() const { return true; }
// Returns true whether this device is "virtual/emulated", not linked
// to any actual physical device. Mostly used by keyboard and mouse devices,
// and to avoid uselessly recreating the device unless really necessary.
// Doesn't necessarily need to be set to true if the device is virtual.
virtual bool IsVirtualDevice() const { return false; }
// (e.g. Xbox 360 controllers have controller number LEDs which should match the ID we use.)
virtual std::optional<int> GetPreferredId() const;