Skip to content

modifier buttons for HID mapping + Digital Cstick#762

Open
NoShadock wants to merge 12 commits intoFIX94:masterfrom
NoShadock:pull-request-HID_with_modifiers_buttons
Open

modifier buttons for HID mapping + Digital Cstick#762
NoShadock wants to merge 12 commits intoFIX94:masterfrom
NoShadock:pull-request-HID_with_modifiers_buttons

Conversation

@NoShadock
Copy link
Copy Markdown

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:

  • Digital CStick: emulate CStick with buttons
  • Modifier buttons: up to 3, to combo with other buttons to extend mapping (like ctrl-shift-alt do on a keyboard)

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):

[INNEXT N64 USB Gamepad]
VID=0079
PID=0006
Polltype=1
DPAD=1
DigitalCStick=1
DigitalLR=1
Mod1=5,10
A=6,04
B=6,10
X=5,20
Y=5,80
Z=5,40
S=6,20
Power=6,35
L=6,08
R=6,02
StickX=0
StickY=1
Up=5,00
Right=5,02
Down=5,04
Left=5,06
RightUp=5,01
DownRight=5,03
DownLeft=5,05
UpLeft=5,07
CStickUp=5,00,1
CStickRight=5,02,1
CStickDown=5,04,1
CStickLeft=5,06,1
CStickRightUp=5,01,1
CStickDownRight=5,03,1
CStickDownLeft=5,05,1
CStickUpLeft=5,07,1
CStickX=0
CStickY=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant