diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/button/Trigger.h b/wpilibNewCommands/src/main/native/include/frc2/command/button/Trigger.h index 30ee4b336c..ec39cd778a 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/button/Trigger.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/button/Trigger.h @@ -487,6 +487,15 @@ class Trigger { return m_event.operator&&(rhs).CastTo(); } + /** + * Composes two triggers with logical AND. + * + * @return A trigger which is active when both component triggers are active. + */ + Trigger operator&&(Trigger& rhs) { + return (m_event && rhs.m_event).CastTo(); + } + /** * Composes two triggers with logical OR. * @@ -496,6 +505,15 @@ class Trigger { return m_event.operator||(rhs).CastTo(); } + /** + * Composes two triggers with logical OR. + * + * @return A trigger which is active when either component trigger is active. + */ + Trigger operator||(Trigger& rhs) { + return (m_event || rhs.m_event).CastTo(); + } + /** * Composes a trigger with logical NOT. *