mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Finish gamepad face button rename (#8921)
This commit is contained in:
@@ -25,14 +25,14 @@ import org.wpilib.util.sendable.SendableBuilder;
|
||||
public class Gamepad extends GenericHID implements Sendable {
|
||||
/** Represents a digital button on a Gamepad. */
|
||||
public enum Button {
|
||||
/** South Face button. */
|
||||
SOUTH_FACE(0, "SouthFaceButton"),
|
||||
/** East Face button. */
|
||||
EAST_FACE(1, "EastFaceButton"),
|
||||
/** West Face button. */
|
||||
WEST_FACE(2, "WestFaceButton"),
|
||||
/** North Face button. */
|
||||
NORTH_FACE(3, "NorthFaceButton"),
|
||||
/** Face Down button. */
|
||||
FACE_DOWN(0, "FaceDownButton"),
|
||||
/** Face Right button. */
|
||||
FACE_RIGHT(1, "FaceRightButton"),
|
||||
/** Face Left button. */
|
||||
FACE_LEFT(2, "FaceLeftButton"),
|
||||
/** Face Up button. */
|
||||
FACE_UP(3, "FaceUpButton"),
|
||||
/** Back button. */
|
||||
BACK(4, "BackButton"),
|
||||
/** Guide button. */
|
||||
@@ -258,30 +258,30 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the value of the South Face button on the controller.
|
||||
* Read the value of the Face Down button on the controller.
|
||||
*
|
||||
* @return The state of the button.
|
||||
*/
|
||||
public boolean getSouthFaceButton() {
|
||||
return getButton(Button.SOUTH_FACE);
|
||||
public boolean getFaceDownButton() {
|
||||
return getButton(Button.FACE_DOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the South Face button was pressed since the last check.
|
||||
* Whether the Face Down button was pressed since the last check.
|
||||
*
|
||||
* @return Whether the button was pressed since the last check.
|
||||
*/
|
||||
public boolean getSouthFaceButtonPressed() {
|
||||
return getButtonPressed(Button.SOUTH_FACE);
|
||||
public boolean getFaceDownButtonPressed() {
|
||||
return getButtonPressed(Button.FACE_DOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the South Face button was released since the last check.
|
||||
* Whether the Face Down button was released since the last check.
|
||||
*
|
||||
* @return Whether the button was released since the last check.
|
||||
*/
|
||||
public boolean getSouthFaceButtonReleased() {
|
||||
return getButtonReleased(Button.SOUTH_FACE);
|
||||
public boolean getFaceDownButtonReleased() {
|
||||
return getButtonReleased(Button.FACE_DOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,34 +292,34 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
* given loop.
|
||||
*/
|
||||
public BooleanEvent faceDown(EventLoop loop) {
|
||||
return button(Button.SOUTH_FACE, loop);
|
||||
return button(Button.FACE_DOWN, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the value of the East Face button on the controller.
|
||||
* Read the value of the Face Right button on the controller.
|
||||
*
|
||||
* @return The state of the button.
|
||||
*/
|
||||
public boolean getEastFaceButton() {
|
||||
return getButton(Button.EAST_FACE);
|
||||
public boolean getFaceRightButton() {
|
||||
return getButton(Button.FACE_RIGHT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the East Face button was pressed since the last check.
|
||||
* Whether the Face Right button was pressed since the last check.
|
||||
*
|
||||
* @return Whether the button was pressed since the last check.
|
||||
*/
|
||||
public boolean getEastFaceButtonPressed() {
|
||||
return getButtonPressed(Button.EAST_FACE);
|
||||
public boolean getFaceRightButtonPressed() {
|
||||
return getButtonPressed(Button.FACE_RIGHT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the East Face button was released since the last check.
|
||||
* Whether the Face Right button was released since the last check.
|
||||
*
|
||||
* @return Whether the button was released since the last check.
|
||||
*/
|
||||
public boolean getEastFaceButtonReleased() {
|
||||
return getButtonReleased(Button.EAST_FACE);
|
||||
public boolean getFaceRightButtonReleased() {
|
||||
return getButtonReleased(Button.FACE_RIGHT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -330,34 +330,34 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
* given loop.
|
||||
*/
|
||||
public BooleanEvent faceRight(EventLoop loop) {
|
||||
return button(Button.EAST_FACE, loop);
|
||||
return button(Button.FACE_RIGHT, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the value of the West Face button on the controller.
|
||||
* Read the value of the Face Left button on the controller.
|
||||
*
|
||||
* @return The state of the button.
|
||||
*/
|
||||
public boolean getWestFaceButton() {
|
||||
return getButton(Button.WEST_FACE);
|
||||
public boolean getFaceLeftButton() {
|
||||
return getButton(Button.FACE_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the West Face button was pressed since the last check.
|
||||
* Whether the Face Left button was pressed since the last check.
|
||||
*
|
||||
* @return Whether the button was pressed since the last check.
|
||||
*/
|
||||
public boolean getWestFaceButtonPressed() {
|
||||
return getButtonPressed(Button.WEST_FACE);
|
||||
public boolean getFaceLeftButtonPressed() {
|
||||
return getButtonPressed(Button.FACE_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the West Face button was released since the last check.
|
||||
* Whether the Face Left button was released since the last check.
|
||||
*
|
||||
* @return Whether the button was released since the last check.
|
||||
*/
|
||||
public boolean getWestFaceButtonReleased() {
|
||||
return getButtonReleased(Button.WEST_FACE);
|
||||
public boolean getFaceLeftButtonReleased() {
|
||||
return getButtonReleased(Button.FACE_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -368,34 +368,34 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
* given loop.
|
||||
*/
|
||||
public BooleanEvent faceLeft(EventLoop loop) {
|
||||
return button(Button.WEST_FACE, loop);
|
||||
return button(Button.FACE_LEFT, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the value of the North Face button on the controller.
|
||||
* Read the value of the Face Up button on the controller.
|
||||
*
|
||||
* @return The state of the button.
|
||||
*/
|
||||
public boolean getNorthFaceButton() {
|
||||
return getButton(Button.NORTH_FACE);
|
||||
public boolean getFaceUpButton() {
|
||||
return getButton(Button.FACE_UP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the North Face button was pressed since the last check.
|
||||
* Whether the Face Up button was pressed since the last check.
|
||||
*
|
||||
* @return Whether the button was pressed since the last check.
|
||||
*/
|
||||
public boolean getNorthFaceButtonPressed() {
|
||||
return getButtonPressed(Button.NORTH_FACE);
|
||||
public boolean getFaceUpButtonPressed() {
|
||||
return getButtonPressed(Button.FACE_UP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the North Face button was released since the last check.
|
||||
* Whether the Face Up button was released since the last check.
|
||||
*
|
||||
* @return Whether the button was released since the last check.
|
||||
*/
|
||||
public boolean getNorthFaceButtonReleased() {
|
||||
return getButtonReleased(Button.NORTH_FACE);
|
||||
public boolean getFaceUpButtonReleased() {
|
||||
return getButtonReleased(Button.FACE_UP);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -406,7 +406,7 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
* given loop.
|
||||
*/
|
||||
public BooleanEvent faceUp(EventLoop loop) {
|
||||
return button(Button.NORTH_FACE, loop);
|
||||
return button(Button.FACE_UP, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1354,10 +1354,10 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
builder.addDoubleProperty("LeftY", () -> getAxisForSendable(Axis.LEFT_Y), null);
|
||||
builder.addDoubleProperty("RightX", () -> getAxisForSendable(Axis.RIGHT_X), null);
|
||||
builder.addDoubleProperty("RightY", () -> getAxisForSendable(Axis.RIGHT_Y), null);
|
||||
builder.addBooleanProperty("SouthFace", () -> getButtonForSendable(Button.SOUTH_FACE), null);
|
||||
builder.addBooleanProperty("EastFace", () -> getButtonForSendable(Button.EAST_FACE), null);
|
||||
builder.addBooleanProperty("WestFace", () -> getButtonForSendable(Button.WEST_FACE), null);
|
||||
builder.addBooleanProperty("NorthFace", () -> getButtonForSendable(Button.NORTH_FACE), null);
|
||||
builder.addBooleanProperty("FaceDown", () -> getButtonForSendable(Button.FACE_DOWN), null);
|
||||
builder.addBooleanProperty("FaceRight", () -> getButtonForSendable(Button.FACE_RIGHT), null);
|
||||
builder.addBooleanProperty("FaceLeft", () -> getButtonForSendable(Button.FACE_LEFT), null);
|
||||
builder.addBooleanProperty("FaceUp", () -> getButtonForSendable(Button.FACE_UP), null);
|
||||
builder.addBooleanProperty("Back", () -> getButtonForSendable(Button.BACK), null);
|
||||
builder.addBooleanProperty("Guide", () -> getButtonForSendable(Button.GUIDE), null);
|
||||
builder.addBooleanProperty("Start", () -> getButtonForSendable(Button.START), null);
|
||||
|
||||
@@ -109,39 +109,39 @@ public class GamepadSim extends GenericHIDSim {
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the value of the South Face button on the controller.
|
||||
* Change the value of the Face Down button on the controller.
|
||||
*
|
||||
* @param value the new value
|
||||
*/
|
||||
public void setSouthFaceButton(boolean value) {
|
||||
setButton(Gamepad.Button.SOUTH_FACE, value);
|
||||
public void setFaceDownButton(boolean value) {
|
||||
setButton(Gamepad.Button.FACE_DOWN, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the value of the East Face button on the controller.
|
||||
* Change the value of the Face Right button on the controller.
|
||||
*
|
||||
* @param value the new value
|
||||
*/
|
||||
public void setEastFaceButton(boolean value) {
|
||||
setButton(Gamepad.Button.EAST_FACE, value);
|
||||
public void setFaceRightButton(boolean value) {
|
||||
setButton(Gamepad.Button.FACE_RIGHT, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the value of the West Face button on the controller.
|
||||
* Change the value of the Face Left button on the controller.
|
||||
*
|
||||
* @param value the new value
|
||||
*/
|
||||
public void setWestFaceButton(boolean value) {
|
||||
setButton(Gamepad.Button.WEST_FACE, value);
|
||||
public void setFaceLeftButton(boolean value) {
|
||||
setButton(Gamepad.Button.FACE_LEFT, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the value of the North Face button on the controller.
|
||||
* Change the value of the Face Up button on the controller.
|
||||
*
|
||||
* @param value the new value
|
||||
*/
|
||||
public void setNorthFaceButton(boolean value) {
|
||||
setButton(Gamepad.Button.NORTH_FACE, value);
|
||||
public void setFaceUpButton(boolean value) {
|
||||
setButton(Gamepad.Button.FACE_UP, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user