Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Button class concrete #2243

Closed
crussell52 opened this issue Jan 8, 2020 · 1 comment · Fixed by #2244
Closed

Make Button class concrete #2243

crussell52 opened this issue Jan 8, 2020 · 1 comment · Fixed by #2244

Comments

@crussell52
Copy link
Contributor

crussell52 commented Jan 8, 2020

Currently, the Button class is abstract but inherits from a concrete class (Trigger) and provides no additional abstract signatures. This prevents Button from being directly instantiated, so it loses the BooleanSupplier benefits that have been added to Trigger.

For example, the following is not possible:

new Button(() -> myButtonLikeInput.isPressed()).whenPressed(myCommand);
@kasemir
Copy link
Contributor

kasemir commented Jan 12, 2020

Just noticed the same yesterday when we wanted to use one of the triggers as a 'button'.
Can do this:

new Trigger(() -> joystick.getTriggerAxis(Hand.kRight) > .5)

.. but allowing actual Button support would be nice:

new Button(() -> joystick.getTriggerAxis(Hand.kRight) > .5)

Thanks for providing a pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants