Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -236,47 +236,47 @@ public Trigger rightStick(EventLoop loop) {
}

/**
* Constructs a Trigger instance around the right shoulder button's digital signal.
* Constructs a Trigger instance around the right bumper button's digital signal.
*
* @return a Trigger instance representing the right shoulder button's digital signal attached to
* @return a Trigger instance representing the right bumper button's digital signal attached to
* the {@link CommandScheduler#getDefaultButtonLoop() default scheduler button loop}.
* @see #leftShoulder(EventLoop)
* @see #leftBumper(EventLoop)
*/
public Trigger leftShoulder() {
return leftShoulder(CommandScheduler.getInstance().getDefaultButtonLoop());
public Trigger leftBumper() {
return leftBumper(CommandScheduler.getInstance().getDefaultButtonLoop());
}

/**
* Constructs a Trigger instance around the right shoulder button's digital signal.
* Constructs a Trigger instance around the right bumper button's digital signal.
*
* @param loop the event loop instance to attach the event to.
* @return a Trigger instance representing the right shoulder button's digital signal attached to
* @return a Trigger instance representing the right bumper button's digital signal attached to
* the given loop.
*/
public Trigger leftShoulder(EventLoop loop) {
return button(Gamepad.Button.kLeftShoulder.value, loop);
public Trigger leftBumper(EventLoop loop) {
return button(Gamepad.Button.kLeftBumper.value, loop);
}

/**
* Constructs a Trigger instance around the right shoulder button's digital signal.
* Constructs a Trigger instance around the right bumper button's digital signal.
*
* @return a Trigger instance representing the right shoulder button's digital signal attached to
* @return a Trigger instance representing the right bumper button's digital signal attached to
* the {@link CommandScheduler#getDefaultButtonLoop() default scheduler button loop}.
* @see #rightShoulder(EventLoop)
* @see #rightBumper(EventLoop)
*/
public Trigger rightShoulder() {
return rightShoulder(CommandScheduler.getInstance().getDefaultButtonLoop());
public Trigger rightBumper() {
return rightBumper(CommandScheduler.getInstance().getDefaultButtonLoop());
}

/**
* Constructs a Trigger instance around the right shoulder button's digital signal.
* Constructs a Trigger instance around the right bumper button's digital signal.
*
* @param loop the event loop instance to attach the event to.
* @return a Trigger instance representing the right shoulder button's digital signal attached to
* @return a Trigger instance representing the right bumper button's digital signal attached to
* the given loop.
*/
public Trigger rightShoulder(EventLoop loop) {
return button(Gamepad.Button.kRightShoulder.value, loop);
public Trigger rightBumper(EventLoop loop) {
return button(Gamepad.Button.kRightBumper.value, loop);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ Trigger CommandGamepad::RightStick(wpi::EventLoop* loop) const {
return Button(wpi::Gamepad::Button::kRightStick, loop);
}

Trigger CommandGamepad::LeftShoulder(wpi::EventLoop* loop) const {
return Button(wpi::Gamepad::Button::kLeftShoulder, loop);
Trigger CommandGamepad::LeftBumper(wpi::EventLoop* loop) const {
return Button(wpi::Gamepad::Button::kLeftBumper, loop);
}

Trigger CommandGamepad::RightShoulder(wpi::EventLoop* loop) const {
return Button(wpi::Gamepad::Button::kRightShoulder, loop);
Trigger CommandGamepad::RightBumper(wpi::EventLoop* loop) const {
return Button(wpi::Gamepad::Button::kRightBumper, loop);
}

Trigger CommandGamepad::DpadUp(wpi::EventLoop* loop) const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,30 +141,28 @@ class CommandGamepad : public CommandGenericHID {
.GetDefaultButtonLoop()) const;

/**
* Constructs a Trigger instance around the right shoulder button's
* Constructs a Trigger instance around the right bumper button's
* digital signal.
*
* @param loop the event loop instance to attach the event to. Defaults to the
* CommandScheduler's default loop.
* @return a Trigger instance representing the right shoulder button's
* @return a Trigger instance representing the right bumper button's
* digital signal attached to the given loop.
*/
Trigger LeftShoulder(
wpi::EventLoop* loop =
CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
Trigger LeftBumper(wpi::EventLoop* loop = CommandScheduler::GetInstance()
.GetDefaultButtonLoop()) const;

/**
* Constructs a Trigger instance around the right shoulder button's
* Constructs a Trigger instance around the right bumper button's
* digital signal.
*
* @param loop the event loop instance to attach the event to. Defaults to the
* CommandScheduler's default loop.
* @return a Trigger instance representing the right shoulder button's
* @return a Trigger instance representing the right bumper button's
* digital signal attached to the given loop.
*/
Trigger RightShoulder(
wpi::EventLoop* loop =
CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
Trigger RightBumper(wpi::EventLoop* loop = CommandScheduler::GetInstance()
.GetDefaultButtonLoop()) const;

/**
* Constructs a Trigger instance around the D-pad up button's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,51 +266,51 @@ public Trigger rightStick(EventLoop loop) {
}

/**
* Constructs a Trigger instance around the right shoulder button's digital signal.
* Constructs a Trigger instance around the right bumper button's digital signal.
*
* @return a Trigger instance representing the right shoulder button's digital signal attached to
* @return a Trigger instance representing the right bumper button's digital signal attached to
* the {@link Scheduler#getDefaultEventLoop() default scheduler event loop} on the scheduler
* passed to the controller's constructor, or the {@link Scheduler#getDefault default
* scheduler} if a scheduler was not explicitly provided.
* @see #leftShoulder(EventLoop)
* @see #leftBumper(EventLoop)
*/
public Trigger leftShoulder() {
return leftShoulder(getScheduler().getDefaultEventLoop());
public Trigger leftBumper() {
return leftBumper(getScheduler().getDefaultEventLoop());
}

/**
* Constructs a Trigger instance around the right shoulder button's digital signal.
* Constructs a Trigger instance around the right bumper button's digital signal.
*
* @param loop the event loop instance to attach the event to.
* @return a Trigger instance representing the right shoulder button's digital signal attached to
* @return a Trigger instance representing the right bumper button's digital signal attached to
* the given loop.
*/
public Trigger leftShoulder(EventLoop loop) {
return button(Gamepad.Button.kLeftShoulder.value, loop);
public Trigger leftBumper(EventLoop loop) {
return button(Gamepad.Button.kLeftBumper.value, loop);
}

/**
* Constructs a Trigger instance around the right shoulder button's digital signal.
* Constructs a Trigger instance around the right bumper button's digital signal.
*
* @return a Trigger instance representing the right shoulder button's digital signal attached to
* @return a Trigger instance representing the right bumper button's digital signal attached to
* the {@link Scheduler#getDefaultEventLoop() default scheduler event loop} on the scheduler
* passed to the controller's constructor, or the {@link Scheduler#getDefault default
* scheduler} if a scheduler was not explicitly provided.
* @see #rightShoulder(EventLoop)
* @see #rightBumper(EventLoop)
*/
public Trigger rightShoulder() {
return rightShoulder(getScheduler().getDefaultEventLoop());
public Trigger rightBumper() {
return rightBumper(getScheduler().getDefaultEventLoop());
}

/**
* Constructs a Trigger instance around the right shoulder button's digital signal.
* Constructs a Trigger instance around the right bumper button's digital signal.
*
* @param loop the event loop instance to attach the event to.
* @return a Trigger instance representing the right shoulder button's digital signal attached to
* @return a Trigger instance representing the right bumper button's digital signal attached to
* the given loop.
*/
public Trigger rightShoulder(EventLoop loop) {
return button(Gamepad.Button.kRightShoulder.value, loop);
public Trigger rightBumper(EventLoop loop) {
return button(Gamepad.Button.kRightBumper.value, loop);
}

/**
Expand Down
41 changes: 20 additions & 21 deletions wpilibc/src/main/native/cpp/driverstation/Gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,37 +202,36 @@ BooleanEvent Gamepad::RightStick(EventLoop* loop) const {
return BooleanEvent(loop, [this]() { return this->GetRightStickButton(); });
}

bool Gamepad::GetLeftShoulderButton() const {
return GetRawButton(Button::kLeftShoulder);
bool Gamepad::GetLeftBumperButton() const {
return GetRawButton(Button::kLeftBumper);
}

bool Gamepad::GetLeftShoulderButtonPressed() {
return GetRawButtonPressed(Button::kLeftShoulder);
bool Gamepad::GetLeftBumperButtonPressed() {
return GetRawButtonPressed(Button::kLeftBumper);
}

bool Gamepad::GetLeftShoulderButtonReleased() {
return GetRawButtonReleased(Button::kLeftShoulder);
bool Gamepad::GetLeftBumperButtonReleased() {
return GetRawButtonReleased(Button::kLeftBumper);
}

BooleanEvent Gamepad::LeftShoulder(EventLoop* loop) const {
return BooleanEvent(loop, [this]() { return this->GetLeftShoulderButton(); });
BooleanEvent Gamepad::LeftBumper(EventLoop* loop) const {
return BooleanEvent(loop, [this]() { return this->GetLeftBumperButton(); });
}

bool Gamepad::GetRightShoulderButton() const {
return GetRawButton(Button::kRightShoulder);
bool Gamepad::GetRightBumperButton() const {
return GetRawButton(Button::kRightBumper);
}

bool Gamepad::GetRightShoulderButtonPressed() {
return GetRawButtonPressed(Button::kRightShoulder);
bool Gamepad::GetRightBumperButtonPressed() {
return GetRawButtonPressed(Button::kRightBumper);
}

bool Gamepad::GetRightShoulderButtonReleased() {
return GetRawButtonReleased(Button::kRightShoulder);
bool Gamepad::GetRightBumperButtonReleased() {
return GetRawButtonReleased(Button::kRightBumper);
}

BooleanEvent Gamepad::RightShoulder(EventLoop* loop) const {
return BooleanEvent(loop,
[this]() { return this->GetRightShoulderButton(); });
BooleanEvent Gamepad::RightBumper(EventLoop* loop) const {
return BooleanEvent(loop, [this]() { return this->GetRightBumperButton(); });
}

bool Gamepad::GetDpadUpButton() const {
Expand Down Expand Up @@ -528,11 +527,11 @@ void Gamepad::InitSendable(wpi::util::SendableBuilder& builder) {
"RightStick",
[this] { return GetButtonForSendable(Button::kRightStick); }, nullptr);
builder.AddBooleanProperty(
"LeftShoulder",
[this] { return GetButtonForSendable(Button::kLeftShoulder); }, nullptr);
"LeftBumper",
[this] { return GetButtonForSendable(Button::kLeftBumper); }, nullptr);
builder.AddBooleanProperty(
"RightShoulder",
[this] { return GetButtonForSendable(Button::kRightShoulder); }, nullptr);
"RightBumper",
[this] { return GetButtonForSendable(Button::kRightBumper); }, nullptr);
builder.AddBooleanProperty(
"DpadUp", [this] { return GetButtonForSendable(Button::kDpadUp); },
nullptr);
Expand Down
8 changes: 4 additions & 4 deletions wpilibc/src/main/native/cpp/simulation/GamepadSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ void GamepadSim::SetRightStickButton(bool value) {
SetRawButton(Gamepad::Button::kRightStick, value);
}

void GamepadSim::SetLeftShoulderButton(bool value) {
SetRawButton(Gamepad::Button::kLeftShoulder, value);
void GamepadSim::SetLeftBumperButton(bool value) {
SetRawButton(Gamepad::Button::kLeftBumper, value);
}

void GamepadSim::SetRightShoulderButton(bool value) {
SetRawButton(Gamepad::Button::kRightShoulder, value);
void GamepadSim::SetRightBumperButton(bool value) {
SetRawButton(Gamepad::Button::kRightBumper, value);
}

void GamepadSim::SetDpadUpButton(bool value) {
Expand Down
44 changes: 22 additions & 22 deletions wpilibc/src/main/native/include/wpi/driverstation/Gamepad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,66 +409,66 @@ class Gamepad : public GenericHID,
BooleanEvent RightStick(EventLoop* loop) const;

/**
* Read the value of the right shoulder button on the controller.
* Read the value of the right bumper button on the controller.
*
* @return The state of the button.
*/
bool GetLeftShoulderButton() const;
bool GetLeftBumperButton() const;

/**
* Whether the right shoulder button was pressed since the last check.
* Whether the right bumper button was pressed since the last check.
*
* @return Whether the button was pressed since the last check.
*/
bool GetLeftShoulderButtonPressed();
bool GetLeftBumperButtonPressed();

/**
* Whether the right shoulder button was released since the last check.
* Whether the right bumper button was released since the last check.
*
* @return Whether the button was released since the last check.
*/
bool GetLeftShoulderButtonReleased();
bool GetLeftBumperButtonReleased();

/**
* Constructs an event instance around the right shoulder button's
* Constructs an event instance around the right bumper button's
* digital signal.
*
* @param loop the event loop instance to attach the event to.
* @return an event instance representing the right shoulder button's
* @return an event instance representing the right bumper button's
* digital signal attached to the given loop.
*/
BooleanEvent LeftShoulder(EventLoop* loop) const;
BooleanEvent LeftBumper(EventLoop* loop) const;

/**
* Read the value of the right shoulder button on the controller.
* Read the value of the right bumper button on the controller.
*
* @return The state of the button.
*/
bool GetRightShoulderButton() const;
bool GetRightBumperButton() const;

/**
* Whether the right shoulder button was pressed since the last check.
* Whether the right bumper button was pressed since the last check.
*
* @return Whether the button was pressed since the last check.
*/
bool GetRightShoulderButtonPressed();
bool GetRightBumperButtonPressed();

/**
* Whether the right shoulder button was released since the last check.
* Whether the right bumper button was released since the last check.
*
* @return Whether the button was released since the last check.
*/
bool GetRightShoulderButtonReleased();
bool GetRightBumperButtonReleased();

/**
* Constructs an event instance around the right shoulder button's
* Constructs an event instance around the right bumper button's
* digital signal.
*
* @param loop the event loop instance to attach the event to.
* @return an event instance representing the right shoulder button's
* @return an event instance representing the right bumper button's
* digital signal attached to the given loop.
*/
BooleanEvent RightShoulder(EventLoop* loop) const;
BooleanEvent RightBumper(EventLoop* loop) const;

/**
* Read the value of the D-pad up button on the controller.
Expand Down Expand Up @@ -955,10 +955,10 @@ class Gamepad : public GenericHID,
static constexpr int kLeftStick = 7;
/// Right stick button.
static constexpr int kRightStick = 8;
/// Right shoulder button.
static constexpr int kLeftShoulder = 9;
/// Right shoulder button.
static constexpr int kRightShoulder = 10;
/// right bumper button.
static constexpr int kLeftBumper = 9;
/// right bumper button.
static constexpr int kRightBumper = 10;
/// D-pad up button.
static constexpr int kDpadUp = 11;
/// D-pad down button.
Expand Down
Loading
Loading