modifier buttons for HID mapping + Digital Cstick #762
+684
−276
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.
To play Wind Waker with my N64-usb gamepad, I needed to emulate a CStick.
I chose to map the DPAD to it when a modifier(shift) button is pressed.
Features
Hence this PR adds 2 features:
Config changes
For Digital CStick, .ini files have new optional items: DigitalCStick {0 or 1}, and the 8 DPAD directions prepended with 'CStick': 4 standard [CStickUp, CStickRight, CStickDown, CStickLeft], 4 situational(if DPAD=1) [CStickRightUp, CStickDownRight, CStickDownLeft, CStickUpLeft]
For Modifiers, .ini files have 3 new optional items: Mod1, Mod2, Mod3 {button layout}
All button layout are now 3 numbers: Offset, Mask, Modifier#
Modifier# should be 0, 1, 2 or 3 ; otherwise defaulted to 0
When Modifier# is omitted, it is defaulted to 0 which means no modifier.
So it is retro-compatible.
When DigitalCStick=1 ; CStickX, CStickY can still be used for Radius to set the cstick value when buttons are pressed, for instance Radius=50 to get an half-pushed.
Config Example (Generic HID - N64 USB):