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 TypeFieldDescriptionboolean
The a button on the right joycon.boolean
The b button on the right joycon.boolean
Capture button.boolean
Charging grip button.boolean
The dpad down button on the left joycon.boolean
The dpad left button on the left joycon.boolean
The dpad right button on the left joycon.boolean
The dpad up button on the left joycon.boolean
Right joycon home button.boolean
The l button on the left joycon.boolean
Left joycon left sl button.boolean
Left joycon right sr button.boolean
The left stick button on the left joycon.double
The left joystick x value.double
The left joystick y value.boolean
The minus button on the left joycon.boolean
The plus button on the right joycon.boolean
The r button on the right joycon.boolean
Right joycon left sl button.boolean
Right joycon right sr button.boolean
The right stick button on the right joycon.double
The right joystick x value.double
The right joystick y value.boolean
The x button on the right joycon.boolean
The y button on the right joycon.boolean
The zl button on the left joycon.boolean
The 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()
-