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:
@@ -20,19 +20,19 @@ Trigger CommandGamepad::Button(enum wpi::Gamepad::Button button,
|
||||
return CommandGenericHID::Button(static_cast<int>(button), loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::SouthFace(wpi::EventLoop* loop) const {
|
||||
Trigger CommandGamepad::FaceDown(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::SOUTH_FACE, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::EastFace(wpi::EventLoop* loop) const {
|
||||
Trigger CommandGamepad::FaceRight(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::EAST_FACE, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::WestFace(wpi::EventLoop* loop) const {
|
||||
Trigger CommandGamepad::FaceLeft(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::WEST_FACE, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::NorthFace(wpi::EventLoop* loop) const {
|
||||
Trigger CommandGamepad::FaceUp(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::NORTH_FACE, loop);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user