I am trying to specify the order in which a PlayerInput should activate its’ default control scheme.
Ideally, I’d set the default control scheme to “Any” on the PlayerInput, and on startup a “Gamepad” control scheme would be tried, followed by a “Touchscreen”, “Mouse” then a “Keyboard” if no other scheme could be activated.
There are two issues I’m running into.
1. Setting the Order in the UI:
There doesn’t seem to be any way to specify the order of Control Schemes via the UI. I can change the order inside the .inputactions file manually but given the order in this file DOES determine the order of the control scheme array handed around in PlayerInput I’d expect a way to manipulate it in the UI.
2. Control Scheme Scoring:
When a control scheme is “scored” the same as another, the order described above matters as the first control scheme with that order will be used as you’d expect. If a later control scheme has a higher score however, that control scheme will be picked over the earlier. This is fine so long as the scoring is.
In my case I’m having trouble understanding how I’d indicate that my generic “Gamepad” control scheme - that meets requirements due to an “XboxOneGamepadMacOSWireless” device being present - should take activation precedence over my “Mouse” control scheme - which meets requirements due to a “Mouse” device being present?
At the code shown in the above link currently, my “Mouse” control scheme is scored a 2, while the “Gamepad” is scored 1.333~. This is because the “Gamepad” device (XboxOneGamepadMacOSWireless) is actually MORE inherited (therefore MORE explicit) than the “Mouse” device (Mouse). So the way scoring is performed currently, the closer a DEVICE is to being generic, the greater it is scored.
TLDR: If I were to plugin an unbranded generic HID gamepad, my “Gamepad” control scheme would be activated before my “Mouse” scheme.
With an explicitly supported Xbox gamepad however, my “Mouse” scheme (and the UI legends that go along with it) is activated before the “Gamepad” scheme.