public class Joystick extends GenericHID
| Modifier and Type | Class and Description |
|---|---|
protected class |
Joystick.JoystickAxis
The Class JoystickAxis.
|
protected class |
Joystick.JoystickButton
The Class JoystickButton.
|
static class |
Joystick.JSID
The Enum JSID.
|
static class |
Joystick.RumbleSide
Rumble control enum
|
| Modifier and Type | Field and Description |
|---|---|
static int |
kNumJoysticks
The Constant kNumJoysticks.
|
private static short[][] |
m_joystickAxes
The m_joystick axes.
|
private static int[] |
m_joystickButtons
The m_joystick buttons.
|
private static byte[] |
m_joystickButtonsCount
The m_joystick buttons count.
|
private static short[][] |
m_joystickPOVs
The m_joystick po vs.
|
private short |
m_leftRumble |
private static double |
m_nextComplainTime |
private int |
m_outputs
The m_outputs.
|
private Joystick.JSID |
m_port
The m_port.
|
private byte |
m_portByte
The m_portByte.
|
private short |
m_rightRumble |
m_axes, m_btns, m_numAxes, m_numBtns| Constructor and Description |
|---|
Joystick(Joystick.JSID port,
int numAxes,
int numBtns)
Instantiates a new joystick.
|
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkStick(int stick)
Check stick.
|
protected static void |
complainJoystickMissing(java.lang.String msg) |
void |
disableModule()
Disable the module
|
void |
enableModule()
Enable the module
|
boolean |
getModuleEnabled() |
int |
getPOV(int pov) |
Joystick |
getStick(Joystick.JSID port,
int numAxes,
int numBtns) |
protected static double |
getStickAxis(Joystick.JSID stick,
int axis)
Gets the stick axis.
|
protected static boolean |
getStickButton(Joystick.JSID stick,
int button)
Gets the stick button.
|
Joystick.JSID |
getStickPort()
Get the Port JSID that this Joystick is on
|
protected static int |
getStickPOV(Joystick.JSID stick,
int pov)
Gets the stick pov.
|
static void |
setJoystickData(int stick,
short[] axes,
short[] povs,
int buttons,
byte numBtns)
Sets the joystick data.
|
void |
setOutput(int outputNumber,
boolean value) |
void |
setOutputs(int value) |
void |
setRumble(Joystick.RumbleSide type,
float value)
Set the rumble output for the joystick.
|
addAxisButton, addButton, checkAxis, checkButton, getAxis, getButton, getRawAxis, getRawButton, setAxis, setAxisDeadband, setAxisInverted, setButtonpublic static final int kNumJoysticks
private static short[][] m_joystickAxes
private static short[][] m_joystickPOVs
private static int[] m_joystickButtons
private static byte[] m_joystickButtonsCount
private static double m_nextComplainTime
private final Joystick.JSID m_port
private final byte m_portByte
private int m_outputs
private short m_leftRumble
private short m_rightRumble
public Joystick(Joystick.JSID port, int numAxes, int numBtns)
port - the portnumAxes - the num axesnumBtns - the num btnspublic static final void setJoystickData(int stick,
short[] axes,
short[] povs,
int buttons,
byte numBtns)
stick - the stickaxes - the axespovs - the povsbuttons - the buttonsnumBtns - the num btnsprotected static final void complainJoystickMissing(java.lang.String msg)
protected static final double getStickAxis(Joystick.JSID stick, int axis)
stick - the stickaxis - the axisprotected static final boolean getStickButton(Joystick.JSID stick, int button)
stick - the stickbutton - the buttonprotected static final int getStickPOV(Joystick.JSID stick, int pov)
stick - the stickpov - the povprotected static void checkStick(int stick)
stick - the stickpublic Joystick getStick(Joystick.JSID port, int numAxes, int numBtns)
public final int getPOV(int pov)
getPOV in class GenericHIDpublic final Joystick.JSID getStickPort()
public final void setRumble(Joystick.RumbleSide type, float value)
type - Which rumble value to setvalue - The normalized value (0 to 1) to set the rumble topublic final void setOutput(int outputNumber,
boolean value)
public final void setOutputs(int value)
public void enableModule()
public void disableModule()
public boolean getModuleEnabled()