[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

@@ -107,20 +107,20 @@ BooleanEvent Gamepad::WestFace(EventLoop* loop) const {
return BooleanEvent(loop, [this]() { return this->GetWestFaceButton(); });
}
bool Gamepad::GetNorthFacenButton() const {
return GetRawButton(Button::kNorthFacen);
bool Gamepad::GetNorthFaceButton() const {
return GetRawButton(Button::kNorthFace);
}
bool Gamepad::GetNorthFacenButtonPressed() {
return GetRawButtonPressed(Button::kNorthFacen);
bool Gamepad::GetNorthFaceButtonPressed() {
return GetRawButtonPressed(Button::kNorthFace);
}
bool Gamepad::GetNorthFacenButtonReleased() {
return GetRawButtonReleased(Button::kNorthFacen);
bool Gamepad::GetNorthFaceButtonReleased() {
return GetRawButtonReleased(Button::kNorthFace);
}
BooleanEvent Gamepad::NorthFacen(EventLoop* loop) const {
return BooleanEvent(loop, [this]() { return this->GetNorthFacenButton(); });
BooleanEvent Gamepad::NorthFace(EventLoop* loop) const {
return BooleanEvent(loop, [this]() { return this->GetNorthFaceButton(); });
}
bool Gamepad::GetBackButton() const {
@@ -512,8 +512,8 @@ void Gamepad::InitSendable(wpi::SendableBuilder& builder) {
"WestFace", [this] { return GetButtonForSendable(Button::kWestFace); },
nullptr);
builder.AddBooleanProperty(
"NorthFacen",
[this] { return GetButtonForSendable(Button::kNorthFacen); }, nullptr);
"NorthFace", [this] { return GetButtonForSendable(Button::kNorthFace); },
nullptr);
builder.AddBooleanProperty(
"Back", [this] { return GetButtonForSendable(Button::kBack); }, nullptr);
builder.AddBooleanProperty(

View File

@@ -57,8 +57,8 @@ void GamepadSim::SetWestFaceButton(bool value) {
SetRawButton(Gamepad::Button::kWestFace, value);
}
void GamepadSim::SetNorthFacenButton(bool value) {
SetRawButton(Gamepad::Button::kNorthFacen, value);
void GamepadSim::SetNorthFaceButton(bool value) {
SetRawButton(Gamepad::Button::kNorthFace, value);
}
void GamepadSim::SetBackButton(bool value) {