Package edu.wpi.first.wpilibj
Enum Class PS4Controller.Button
- All Implemented Interfaces:
Serializable
,Comparable<PS4Controller.Button>
,Constable
- Enclosing class:
- PS4Controller
Represents a digital button on a PS4Controller.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionCircle button.Cross button.Left trigger 1 button.Left trigger 2 button.L3 (left stick) button.Options button.PlayStation button.Right trigger 1 button.Right trigger 2 button.R3 (right stick) button.Share button.Square button.Touchpad button.Triangle button. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiontoString()
Get the human-friendly name of the button, matching the relevant methods.static PS4Controller.Button
Returns the enum constant of this class with the specified name.static PS4Controller.Button[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
kSquare
Square button. -
kCross
Cross button. -
kCircle
Circle button. -
kTriangle
Triangle button. -
kL1
Left trigger 1 button. -
kR1
Right trigger 1 button. -
kL2
Left trigger 2 button. -
kR2
Right trigger 2 button. -
kOptions
Options button. -
kL3
L3 (left stick) button. -
kR3
R3 (right stick) button. -
kPS
PlayStation button. -
kTouchpad
Touchpad button.
-
-
Field Details
-
value
Button value.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
Get the human-friendly name of the button, matching the relevant methods. This is done by stripping the leading `k`, and appending `Button`.Primarily used for automated unit tests.
- Overrides:
toString
in classEnum<PS4Controller.Button>
- Returns:
- the human-friendly name of the button.
-