[wpilib,cmd] Remove Axis from Gamepad Triggers (#8956)

It's a bit confusing, especially since some controllers will have this be
a 0:1 button rather than axis.
This commit is contained in:
Thad House
2026-06-12 06:42:06 -07:00
committed by GitHub
parent d6fb871a26
commit 5a7d7d50ee
11 changed files with 47 additions and 49 deletions

View File

@@ -873,22 +873,22 @@ public class CommandGamepad {
}
/**
* Get the left trigger axis value of the controller. Note that this axis is bound to the range of
* [0, 1] as opposed to the usual [-1, 1].
* Get the left trigger value of the controller. Note that this axis is bound to the range of [0,
* 1] as opposed to the usual [-1, 1].
*
* @return The axis value.
*/
public double getLeftTriggerAxis() {
return m_gamepad.getLeftTriggerAxis();
public double getLeftTrigger() {
return m_gamepad.getLeftTrigger();
}
/**
* Get the right trigger axis value of the controller. Note that this axis is bound to the range
* of [0, 1] as opposed to the usual [-1, 1].
* Get the right trigger value of the controller. Note that this axis is bound to the range of [0,
* 1] as opposed to the usual [-1, 1].
*
* @return The axis value.
*/
public double getRightTriggerAxis() {
return m_gamepad.getRightTriggerAxis();
public double getRightTrigger() {
return m_gamepad.getRightTrigger();
}
}

View File

@@ -181,10 +181,10 @@ double CommandGamepad::GetRightY() const {
return m_gamepad->GetRightY();
}
double CommandGamepad::GetLeftTriggerAxis() const {
return m_gamepad->GetLeftTriggerAxis();
double CommandGamepad::GetLeftTrigger() const {
return m_gamepad->GetLeftTrigger();
}
double CommandGamepad::GetRightTriggerAxis() const {
return m_gamepad->GetRightTriggerAxis();
double CommandGamepad::GetRightTrigger() const {
return m_gamepad->GetRightTrigger();
}

View File

@@ -494,20 +494,20 @@ class CommandGamepad {
double GetRightY() const;
/**
* Get the left trigger axis value of the controller. Note that this axis is
* Get the left trigger value of the controller. Note that this axis is
* bound to the range of [0, 1] as opposed to the usual [-1, 1].
*
* @return The axis value.
*/
double GetLeftTriggerAxis() const;
double GetLeftTrigger() const;
/**
* Get the right trigger axis value of the controller. Note that this axis is
* Get the right trigger value of the controller. Note that this axis is
* bound to the range of [0, 1] as opposed to the usual [-1, 1].
*
* @return The axis value.
*/
double GetRightTriggerAxis() const;
double GetRightTrigger() const;
private:
CommandGenericHID* m_hid;