Package me.autobot.lib.controls
Class NintendoJoycon
java.lang.Object
me.autobot.lib.controls.NintendoJoycon
- All Implemented Interfaces:
Gamepad
Nintendo Switch Joycon controller, both left and right combined into one class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanThe a button on the right joycon.booleanThe b button on the right joycon.booleanCapture button.booleanCharging grip button.booleanThe dpad down button on the left joycon.booleanThe dpad left button on the left joycon.booleanThe dpad right button on the left joycon.booleanThe dpad up button on the left joycon.booleanRight joycon home button.booleanThe l button on the left joycon.booleanLeft joycon left sl button.booleanLeft joycon right sr button.booleanThe left stick button on the left joycon.doubleThe left joystick x value.doubleThe left joystick y value.booleanThe minus button on the left joycon.booleanThe plus button on the right joycon.booleanThe r button on the right joycon.booleanRight joycon left sl button.booleanRight joycon right sr button.booleanThe right stick button on the right joycon.doubleThe right joystick x value.doubleThe right joystick y value.booleanThe x button on the right joycon.booleanThe y button on the right joycon.booleanThe zl button on the left joycon.booleanThe zr button on the right joycon. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
a
public boolean aThe a button on the right joycon. -
b
public boolean bThe b button on the right joycon. -
x
public boolean xThe x button on the right joycon. -
y
public boolean yThe y button on the right joycon. -
l
public boolean lThe l button on the left joycon. -
r
public boolean rThe r button on the right joycon. -
zl
public boolean zlThe zl button on the left joycon. -
zr
public boolean zrThe zr button on the right joycon. -
minus
public boolean minusThe minus button on the left joycon. -
plus
public boolean plusThe plus button on the right joycon. -
leftStick
public boolean leftStickThe left stick button on the left joycon. -
rightStick
public boolean rightStickThe right stick button on the right joycon. -
dpadUp
public boolean dpadUpThe dpad up button on the left joycon. -
dpadDown
public boolean dpadDownThe dpad down button on the left joycon. -
dpadLeft
public boolean dpadLeftThe dpad left button on the left joycon. -
dpadRight
public boolean dpadRightThe dpad right button on the left joycon. -
rightSl
public boolean rightSlRight joycon left sl button. -
rightSr
public boolean rightSrRight joycon right sr button. -
leftSl
public boolean leftSlLeft joycon left sl button. -
leftSr
public boolean leftSrLeft joycon right sr button. -
home
public boolean homeRight joycon home button. -
capture
public boolean captureCapture button. -
chargingGrip
public boolean chargingGripCharging grip button. -
leftStickX
public double leftStickXThe left joystick x value. -
leftStickY
public double leftStickYThe left joystick y value. -
rightStickX
public double rightStickXThe right joystick x value. -
rightStickY
public double rightStickYThe right joystick y value.
-
-
Constructor Details
-
NintendoJoycon
public NintendoJoycon(byte eventByte) Creates a new SwitchJoycons object.- Parameters:
eventByte- The event byte to listen for (in the event addresses).
-
-
Method Details
-
getJoycon
Gets the joycon with the given event byte. If it does not exist, it will create a new joycon.- Parameters:
eventByte- The event byte to get the joycon for.- Returns:
- The joycon with the given event byte.
-
getLeftX
public double getLeftX() -
getLeftY
public double getLeftY() -
getRightX
public double getRightX() -
getRightY
public double getRightY()
-