mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[commands] Add Trigger.onChange() (#6390)
This commit is contained in:
@@ -57,6 +57,23 @@ class Trigger {
|
||||
|
||||
Trigger(const Trigger& other);
|
||||
|
||||
/**
|
||||
* Starts the command when the condition changes.
|
||||
*
|
||||
* @param command the command to start
|
||||
* @return this trigger, so calls can be chained
|
||||
*/
|
||||
Trigger OnChange(Command* command);
|
||||
|
||||
/**
|
||||
* Starts the command when the condition changes. Moves command ownership to
|
||||
* the button scheduler.
|
||||
*
|
||||
* @param command the command to start
|
||||
* @return this trigger, so calls can be chained
|
||||
*/
|
||||
Trigger OnChange(CommandPtr&& command);
|
||||
|
||||
/**
|
||||
* Starts the given command whenever the condition changes from `false` to
|
||||
* `true`.
|
||||
|
||||
Reference in New Issue
Block a user