summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
diff options
context:
space:
mode:
authorFiloppi <filippotarpini@hotmail.it>2021-05-15 12:14:11 +0300
committerFiloppi <filippotarpini@hotmail.it>2021-06-07 11:07:06 +0300
commitdcc345400e38e54ac84819e5cbcdf65c9cd95f96 (patch)
treefdba03b6c2fcd0b94d75fb8792639990d1236a03 /Source/Core/InputCommon/ControllerInterface/CoreDevice.h
parent0718cfd7d781952eff53f052466faaea6b5f3a2f (diff)
ControllerInterface: devices population is now async so implement devices sorting priority
This helps us keeping the most important devices (e.g. Mouse and Keyboard) on the top of the list of devices (they still are on all OSes supported by dolphin and to make hotplug devices like DSU appear at the bottom.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/CoreDevice.h')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/CoreDevice.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
index 1994cb402c..e094d2477d 100644
--- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
+++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
@@ -128,6 +128,11 @@ public:
// (e.g. Xbox 360 controllers have controller number LEDs which should match the ID we use.)
virtual std::optional<int> GetPreferredId() const;
+ // Use this to change the order in which devices are sorted in their list.
+ // A higher priority means it will be one of the first ones (smaller index), making it more
+ // likely to be index 0, which is automatically set as the default device when there isn't one.
+ virtual int GetSortPriority() const { return 0; }
+
const std::vector<Input*>& Inputs() const { return m_inputs; }
const std::vector<Output*>& Outputs() const { return m_outputs; }