Trigger

class commands1.buttons.Trigger

Bases: wpiutil._wpiutil.Sendable

This class provides an easy way to link commands to inputs.

It is very easy to link a polled input to a command. For instance, you could link the trigger button of a joystick to a “score” command or an encoder reaching a particular value.

It is encouraged that teams write a subclass of Trigger if they want to have something unusual (for instance, if they want to react to the user holding a button while the robot is reading a certain sensor input). For this, they only have to write the Trigger::Get() method to get the full functionality of the Trigger class.

This class is provided by the OldCommands VendorDep

cancelWhenActive(command: commands1._impl._commands_v1.command.Command) None
get() bool
grab() bool
initSendable(builder: wpiutil._wpiutil.SendableBuilder) None
toggleWhenActive(command: commands1._impl._commands_v1.command.Command) None
whenActive(command: commands1._impl._commands_v1.command.Command) None
whenInactive(command: commands1._impl._commands_v1.command.Command) None
whileActive(command: commands1._impl._commands_v1.command.Command) None