This adds the Input API, which can be used for advanced input use-cases. Normally, you can just check if a button is pressed or not by getting opMode.gamepad1.a or opMode.gamepad1.x. This enhances that functionality by also detecting presses and releases. It works by calling the update() function within the runloop, and detecting the difference in button presses.
This is inspired by last year's GamepadEx API, but has a few major differences:
Input: The main API to access these inputs. Provides shortcuts for detecting presses and releases for gamepad1.
GamepadEx: A class that handles the actual change detection. You can access it by getting Input.gamepad1 or Input.gamepad2.
Button: An enum that represents every single boolean button. (Note that this does not support joystick positions, the trigger buttons, the touchpad, and PS4 aliases.)
Closes #31!
This adds the
Input
API, which can be used for advanced input use-cases. Normally, you can just check if a button is pressed or not by gettingopMode.gamepad1.a
oropMode.gamepad1.x
. This enhances that functionality by also detecting presses and releases. It works by calling theupdate()
function within the runloop, and detecting the difference in button presses.This is inspired by last year's
GamepadEx
API, but has a few major differences:Input
: The main API to access these inputs. Provides shortcuts for detecting presses and releases forgamepad1
.GamepadEx
: A class that handles the actual change detection. You can access it by gettingInput.gamepad1
orInput.gamepad2
.Button
: An enum that represents every single boolean button. (Note that this does not support joystick positions, the trigger buttons, the touchpad, and PS4 aliases.)