Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Joystick Buttons L3 and R3 #45

Open
wants to merge 1 commit into
base: ios14
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions DeltaCore/Game Controllers/MFi/MFiGameController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ extension MFiGameController
case leftThumbstickDown
case leftThumbstickLeft
case leftThumbstickRight

case leftThumbstickButton

case rightThumbstickUp
case rightThumbstickDown
case rightThumbstickLeft
case rightThumbstickRight

case rightThumbstickButton

case a
case b
case x
Expand Down Expand Up @@ -177,12 +179,15 @@ public class MFiGameController: NSObject, GameController
profile.buttons[GCInputButtonB]?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.b, pressed) }
profile.buttons[GCInputButtonX]?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.x, pressed) }
profile.buttons[GCInputButtonY]?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.y, pressed) }

profile.buttons[GCInputLeftShoulder]?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.leftShoulder, pressed) }
profile.buttons[GCInputLeftTrigger]?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.leftTrigger, pressed) }
profile.buttons[GCInputRightShoulder]?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.rightShoulder, pressed) }
profile.buttons[GCInputRightTrigger]?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.rightTrigger, pressed) }


profile.buttons[GCInputLeftThumbstickButton]?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.leftThumbstickButton, pressed) }
profile.buttons[GCInputRightThumbstickButton]?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.rightThumbstickButton, pressed) }

// Menu = Primary menu button (Start/+/Menu)
let menuButton = profile.buttons[GCInputButtonMenu]
menuButton?.pressedChangedHandler = { (button, value, pressed) in inputChangedHandler(.menu, pressed) }
Expand Down
6 changes: 4 additions & 2 deletions DeltaCore/Model/Inputs/StandardGameControllerInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ public enum StandardGameControllerInput: String, Codable
case leftThumbstickDown
case leftThumbstickLeft
case leftThumbstickRight

case leftThumbstickButton

case rightThumbstickUp
case rightThumbstickDown
case rightThumbstickLeft
case rightThumbstickRight

case rightThumbstickButton

case a
case b
case x
Expand Down