mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib,cmd] Rename gamepad face-button trigger APIs to directional names (faceUp/Down/Left/Right) (#8896)
This updates gamepad trigger naming from cardinal-style face buttons
(`northFace/southFace/eastFace/westFace` and
`NorthFace/SouthFace/EastFace/WestFace`) to directional naming
(`faceUp/faceDown/faceRight/faceLeft` and
`FaceUp/FaceDown/FaceRight/FaceLeft`) to match the requested API shape.
The change is applied across Java and C++ HID/command layers, along with
related examples and binding metadata.
- **API surface updates (Java)**
- Renamed trigger/event methods in:
- `wpilibj` `Gamepad`
- `commandsv2` `CommandGamepad`
- `commandsv3` `CommandGamepad`
- Mapping preserved:
- `southFace` → `faceDown`
- `eastFace` → `faceRight`
- `westFace` → `faceLeft`
- `northFace` → `faceUp`
- **API surface updates (C++)**
- Renamed trigger/event methods in:
- `wpilibc` `Gamepad`
- `commandsv2` `CommandGamepad`
- Mapping preserved:
- `SouthFace` → `FaceDown`
- `EastFace` → `FaceRight`
- `WestFace` → `FaceLeft`
- `NorthFace` → `FaceUp`
- **Python semiwrap updates**
- Updated `wpilibc/src/main/python/semiwrap/Gamepad.yml` method mappings
to the renamed C++ method names (`FaceDown/FaceRight/FaceLeft/FaceUp`).
- **Callsite migration**
- Updated Java examples/template code and C++ examples/template code to
use the new method names so samples remain aligned with the API rename.
- **Docs/comments alignment**
- Updated related Javadoc/reference text and example comments to use
directional terminology.
```java
// Before
driverController.southFace().onTrue(command);
driverController.eastFace().onTrue(command);
// After
driverController.faceDown().onTrue(command);
driverController.faceRight().onTrue(command);
```
```cpp
// Before
driverController.SouthFace().OnTrue(command);
driverController.EastFace().OnTrue(command);
// After
driverController.FaceDown().OnTrue(command);
driverController.FaceRight().OnTrue(command);
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ThadHouse <7727148+ThadHouse@users.noreply.github.com>
This commit is contained in:
@@ -285,13 +285,13 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an event instance around the South Face button's digital signal.
|
||||
* Constructs an event instance around the Face Down button's digital signal.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return an event instance representing the South Face button's digital signal attached to the
|
||||
* @return an event instance representing the Face Down button's digital signal attached to the
|
||||
* given loop.
|
||||
*/
|
||||
public BooleanEvent southFace(EventLoop loop) {
|
||||
public BooleanEvent faceDown(EventLoop loop) {
|
||||
return button(Button.SOUTH_FACE, loop);
|
||||
}
|
||||
|
||||
@@ -323,13 +323,13 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an event instance around the East Face button's digital signal.
|
||||
* Constructs an event instance around the Face Right button's digital signal.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return an event instance representing the East Face button's digital signal attached to the
|
||||
* @return an event instance representing the Face Right button's digital signal attached to the
|
||||
* given loop.
|
||||
*/
|
||||
public BooleanEvent eastFace(EventLoop loop) {
|
||||
public BooleanEvent faceRight(EventLoop loop) {
|
||||
return button(Button.EAST_FACE, loop);
|
||||
}
|
||||
|
||||
@@ -361,13 +361,13 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an event instance around the West Face button's digital signal.
|
||||
* Constructs an event instance around the Face Left button's digital signal.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return an event instance representing the West Face button's digital signal attached to the
|
||||
* @return an event instance representing the Face Left button's digital signal attached to the
|
||||
* given loop.
|
||||
*/
|
||||
public BooleanEvent westFace(EventLoop loop) {
|
||||
public BooleanEvent faceLeft(EventLoop loop) {
|
||||
return button(Button.WEST_FACE, loop);
|
||||
}
|
||||
|
||||
@@ -399,13 +399,13 @@ public class Gamepad extends GenericHID implements Sendable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an event instance around the North Face button's digital signal.
|
||||
* Constructs an event instance around the Face Up button's digital signal.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return an event instance representing the North Face button's digital signal attached to the
|
||||
* @return an event instance representing the Face Up button's digital signal attached to the
|
||||
* given loop.
|
||||
*/
|
||||
public BooleanEvent northFace(EventLoop loop) {
|
||||
public BooleanEvent faceUp(EventLoop loop) {
|
||||
return button(Button.NORTH_FACE, loop);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user