Class Trigger
java.lang.Object
io.github.tigerbotics7125.tigerlib.input.trigger.Trigger
- All Implemented Interfaces:
- edu.wpi.first.util.sendable.Sendable,- BooleanSupplier
- Direct Known Subclasses:
- JoystickAxisTrigger,- JoystickPOVTrigger,- JoystickTrigger
public class Trigger
extends Object
implements BooleanSupplier, edu.wpi.first.util.sendable.Sendable
This class provides a way to track a boolean compared to time as a circuit would.
 
This class is meant to be a replacement for WPILib's version. Anything that uses a WPILib Trigger can easily be converted to work with this class.
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionTrigger(BooleanSupplier input) Create a newTriggerObject.Trigger(BooleanSupplier input, edu.wpi.first.math.filter.Debouncer debouncer) Create aTriggerObject with a debouncer on a raw input.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddisable()Disables thisTrigger.voidenable()Enables thisTrigger.booleanvoidinitSendable(edu.wpi.first.util.sendable.SendableBuilder builder) booleanbooleanjoin(TriggerGroup triggerGroup) leave(TriggerGroup triggerGroup) not()Create aTriggerrepresenting a logical NOT.trigger(Trigger.ActivationCondition activateFor, edu.wpi.first.wpilibj2.command.Command cmd) Execute the given command when/while thisTriggeris triggered.
- 
Constructor Details
- 
Method Details- 
getAsBooleanpublic boolean getAsBoolean()- Specified by:
- getAsBooleanin interface- BooleanSupplier
- Returns:
- The input to this Trigger.
 
- 
join
- 
leave
- 
triggerpublic Trigger trigger(Trigger.ActivationCondition activateFor, edu.wpi.first.wpilibj2.command.Command cmd) Execute the given command when/while thisTriggeris triggered.- Parameters:
- cmd- The Command to trigger.
- Returns:
- This Triggerfor chaining methods.
 
- 
enablepublic void enable()Enables thisTrigger.
- 
disablepublic void disable()Disables thisTrigger.
- 
isEnabledpublic boolean isEnabled()- Returns:
- If this Triggeris enabled.
 
- 
isDisabledpublic boolean isDisabled()- Returns:
- If this Triggeris disabled.
 
- 
and
- 
nand
- 
or
- 
xor
- 
nor
- 
xnor
- 
notCreate aTriggerrepresenting a logical NOT.NOT |A||B| |0||1| |1||0| - Returns:
- A Triggerrepresenting logical NOT.
 
- 
initSendablepublic void initSendable(edu.wpi.first.util.sendable.SendableBuilder builder) - Specified by:
- initSendablein interface- edu.wpi.first.util.sendable.Sendable
 
 
-