xinput: allow to map triggers as positive or negative #15932
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By pressing ALT while clicking on a button in the pad settings, you can now enable a special mode for XInput.
This allows you to map the XInput triggers as positive or negative triggers.
We previously basically always treated XInput triggers as buttons. So you could only map pressing the trigger to a button.
The special mode will treat triggers that are pressed more than 50% as positive triggers and triggers that are pressed less than 50% as negative triggers.
You can therefore map a trigger to an entire stick axis, for example by mapping LT+ to LY+ and LT- to LY-.
This has only become feasible recently when I implemented that the initial state is ignored during a re-map.
In order to map a negative trigger, you will have to press the trigger before clicking one of the buttons in the pad settings dialog (with ALT). Then by releasing the trigger it will be recognized as negative.
You can still map the normal trigger behaviour to other buttons, even if it is already mapped as positive or negative trigger somewhere else.
The stick thresholds are ignored for these new trigger types. I can add them at a later point if needed.
Currently this is only useful for Rock Band guitar switches.
maybe fixes #12384