public abstract class GamepadBase extends GenericHID
GenericHID.Hand, GenericHID.HIDType, GenericHID.RumbleType
Constructor and Description |
---|
GamepadBase(int port) |
Modifier and Type | Method and Description |
---|---|
boolean |
getBumper()
Is the bumper pressed.
|
abstract boolean |
getBumper(GenericHID.Hand hand)
Is the bumper pressed.
|
abstract java.lang.String |
getName()
Get the name of the HID.
|
abstract int |
getPOV(int pov)
Get the angle in degrees of a POV on the HID.
|
abstract int |
getPOVCount()
For the current HID, return the number of POVs.
|
abstract double |
getRawAxis(int axis)
Get the raw axis.
|
abstract boolean |
getRawButton(int button)
Is the given button pressed.
|
boolean |
getStickButton() |
abstract boolean |
getStickButton(GenericHID.Hand hand) |
abstract GenericHID.HIDType |
getType()
Get the type of the HID.
|
abstract void |
setOutput(int outputNumber,
boolean value)
Set a single HID output value for the HID.
|
abstract void |
setOutputs(int value)
Set all HID output values for the HID.
|
abstract void |
setRumble(GenericHID.RumbleType type,
double value)
Set the rumble output for the HID.
|
public GamepadBase(int port)
public abstract double getRawAxis(int axis)
GenericHID
getRawAxis
in class GenericHID
axis
- index of the axispublic abstract boolean getBumper(GenericHID.Hand hand)
hand
- which handpublic boolean getBumper()
public abstract boolean getStickButton(GenericHID.Hand hand)
public boolean getStickButton()
public abstract boolean getRawButton(int button)
GenericHID
getRawButton
in class GenericHID
button
- which button numberpublic abstract int getPOV(int pov)
GenericHID
The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90, upper-left is 315).
getPOV
in class GenericHID
pov
- The index of the POV to read (starting at 0)public abstract int getPOVCount()
GenericHID
getPOVCount
in class GenericHID
public abstract GenericHID.HIDType getType()
GenericHID
getType
in class GenericHID
public abstract java.lang.String getName()
GenericHID
getName
in class GenericHID
public abstract void setOutput(int outputNumber, boolean value)
GenericHID
setOutput
in class GenericHID
outputNumber
- The index of the output to set (1-32)value
- The value to set the output topublic abstract void setOutputs(int value)
GenericHID
setOutputs
in class GenericHID
value
- The 32 bit output value (1 bit for each output)public abstract void setRumble(GenericHID.RumbleType type, double value)
GenericHID
setRumble
in class GenericHID
type
- Which rumble value to setvalue
- The normalized value (0 to 1) to set the rumble to