[cmd3,wpilib] Add CommandGamepad for V3 commands (#8311)

Also fix typo.

Co-authored-by: Dan Katzuv <31829093+katzuv@users.noreply.github.com>
This commit is contained in:
Thad House
2025-11-01 16:24:22 +00:00
committed by GitHub
parent bd2cecbb1a
commit 4da2511638
10 changed files with 852 additions and 39 deletions

View File

@@ -31,7 +31,7 @@ public class Gamepad extends GenericHID implements Sendable {
/** West Face button. */
kWestFace(2),
/** North Face button. */
kNorthFacen(3),
kNorthFace(3),
/** Back button. */
kBack(4),
/** Guide button. */
@@ -376,8 +376,8 @@ public class Gamepad extends GenericHID implements Sendable {
*
* @return The state of the button.
*/
public boolean getNorthFacenButton() {
return getRawButton(Button.kNorthFacen.value);
public boolean getNorthFaceButton() {
return getRawButton(Button.kNorthFace.value);
}
/**
@@ -385,8 +385,8 @@ public class Gamepad extends GenericHID implements Sendable {
*
* @return Whether the button was pressed since the last check.
*/
public boolean getNorthFacenButtonPressed() {
return getRawButtonPressed(Button.kNorthFacen.value);
public boolean getNorthFaceButtonPressed() {
return getRawButtonPressed(Button.kNorthFace.value);
}
/**
@@ -394,8 +394,8 @@ public class Gamepad extends GenericHID implements Sendable {
*
* @return Whether the button was released since the last check.
*/
public boolean getNorthFacenButtonReleased() {
return getRawButtonReleased(Button.kNorthFacen.value);
public boolean getNorthFaceButtonReleased() {
return getRawButtonReleased(Button.kNorthFace.value);
}
/**
@@ -405,8 +405,8 @@ public class Gamepad extends GenericHID implements Sendable {
* @return an event instance representing the North Face button's digital signal attached to the
* given loop.
*/
public BooleanEvent northFacen(EventLoop loop) {
return button(Button.kNorthFacen.value, loop);
public BooleanEvent northFace(EventLoop loop) {
return button(Button.kNorthFace.value, loop);
}
/**
@@ -1272,7 +1272,7 @@ public class Gamepad extends GenericHID implements Sendable {
builder.addBooleanProperty(
"WestFace", () -> getButtonForSendable(Button.kWestFace.value), null);
builder.addBooleanProperty(
"NorthFacen", () -> getButtonForSendable(Button.kNorthFacen.value), null);
"NorthFace", () -> getButtonForSendable(Button.kNorthFace.value), null);
builder.addBooleanProperty("Back", () -> getButtonForSendable(Button.kBack.value), null);
builder.addBooleanProperty("Guide", () -> getButtonForSendable(Button.kGuide.value), null);
builder.addBooleanProperty("Start", () -> getButtonForSendable(Button.kStart.value), null);

View File

@@ -120,8 +120,8 @@ public class GamepadSim extends GenericHIDSim {
*
* @param value the new value
*/
public void setNorthFacenButton(boolean value) {
setRawButton(Gamepad.Button.kNorthFacen.value, value);
public void setNorthFaceButton(boolean value) {
setRawButton(Gamepad.Button.kNorthFace.value, value);
}
/**