I don't think it's possible. Button.whenPressed() calls Trigger.whenActive(), which adds a ButtonScheduler to the Scheduler's internal list of buttons. I don't think there's a way to remove it. I believe there is an alternative, though.
Custom buttons are pretty easy to make, they just need a get() method. So, if you want an easy way to disable a certain button binding, have a variable:
Code:
Button doubleBoundButton; // this is the button you want to trigger differently at different times
boolean initialBindingEnabled = true;
Button initialBinding = new Button() {
public boolean get() {
return initialBindingEnabled && doubleBoundButton.get();
}
},
secondaryBinding = new Button() {
public boolean get() {
return !initialBindingEnabled && doubleBoundButton.get();
}
};
You can then bind different things to each:
Code:
initialBinding.whenPressed(new DoSomething());
secondaryBinding.whenPressed(new DoSomethingElse());
Then, to toggle which is enabled:
Code:
initialBindingEnabled = !initialBindingEnabled;