Class NintendoJoycon

java.lang.Object
me.autobot.lib.controls.NintendoJoycon
All Implemented Interfaces:
Gamepad

public class NintendoJoycon extends Object implements Gamepad
Nintendo Switch Joycon controller, both left and right combined into one class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    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
    Constructor
    Description
    NintendoJoycon(byte eventByte)
    Creates a new SwitchJoycons object.
  • Method Summary

    Modifier and Type
    Method
    Description
    getJoycon(byte eventByte)
    Gets the joycon with the given event byte.
    double
     
    double
     
    double
     
    double
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • a

      public boolean a
      The a button on the right joycon.
    • b

      public boolean b
      The b button on the right joycon.
    • x

      public boolean x
      The x button on the right joycon.
    • y

      public boolean y
      The y button on the right joycon.
    • l

      public boolean l
      The l button on the left joycon.
    • r

      public boolean r
      The r button on the right joycon.
    • zl

      public boolean zl
      The zl button on the left joycon.
    • zr

      public boolean zr
      The zr button on the right joycon.
    • minus

      public boolean minus
      The minus button on the left joycon.
    • plus

      public boolean plus
      The plus button on the right joycon.
    • leftStick

      public boolean leftStick
      The left stick button on the left joycon.
    • rightStick

      public boolean rightStick
      The right stick button on the right joycon.
    • dpadUp

      public boolean dpadUp
      The dpad up button on the left joycon.
    • dpadDown

      public boolean dpadDown
      The dpad down button on the left joycon.
    • dpadLeft

      public boolean dpadLeft
      The dpad left button on the left joycon.
    • dpadRight

      public boolean dpadRight
      The dpad right button on the left joycon.
    • rightSl

      public boolean rightSl
      Right joycon left sl button.
    • rightSr

      public boolean rightSr
      Right joycon right sr button.
    • leftSl

      public boolean leftSl
      Left joycon left sl button.
    • leftSr

      public boolean leftSr
      Left joycon right sr button.
    • home

      public boolean home
      Right joycon home button.
    • capture

      public boolean capture
      Capture button.
    • chargingGrip

      public boolean chargingGrip
      Charging grip button.
    • leftStickX

      public double leftStickX
      The left joystick x value.
    • leftStickY

      public double leftStickY
      The left joystick y value.
    • rightStickX

      public double rightStickX
      The right joystick x value.
    • rightStickY

      public double rightStickY
      The 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

      public static NintendoJoycon getJoycon(byte eventByte)
      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()
      Specified by:
      getLeftX in interface Gamepad
    • getLeftY

      public double getLeftY()
      Specified by:
      getLeftY in interface Gamepad
    • getRightX

      public double getRightX()
      Specified by:
      getRightX in interface Gamepad
    • getRightY

      public double getRightY()
      Specified by:
      getRightY in interface Gamepad