Package frc.robot.input
Class Input
java.lang.Object
frc.robot.input.Input
- Direct Known Subclasses:
AutoInput,TeleopInput
Base class for input handling in the robot.
Extend this class to implement specific input types like TeleopInput or AutoInput.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionabstract doubleGets the axis value for a specific axis.protected edu.wpi.first.wpilibj.event.BooleanEventprotected abstract Function<edu.wpi.first.wpilibj.event.EventLoop,edu.wpi.first.wpilibj.event.BooleanEvent> booleanGets the button pressed value for a specific button.booleanGets the button released value for a specific button.booleanGets the (raw) button value for a specific button.voidreset()Resets the input object, resetting all button bindings.voidupdate()Update the input loop periodically.
-
Method Details
-
reset
public void reset()Resets the input object, resetting all button bindings. -
update
public void update()Update the input loop periodically. -
getAxisValue
Gets the axis value for a specific axis.- Parameters:
key- the axis identifier- Returns:
- the axis value
-
getButtonValue
Gets the (raw) button value for a specific button.- Parameters:
key- the button identifier- Returns:
- the (raw) button value
-
getButtonPressed
Gets the button pressed value for a specific button.- Parameters:
key- the button identifier- Returns:
- the button pressed value
-
getButtonReleased
Gets the button released value for a specific button.- Parameters:
key- the button identifier- Returns:
- the button released value
-
getButton
protected abstract Function<edu.wpi.first.wpilibj.event.EventLoop,edu.wpi.first.wpilibj.event.BooleanEvent> getButton(InputTypes.ButtonInput key) -
getBooleanEvent
protected edu.wpi.first.wpilibj.event.BooleanEvent getBooleanEvent(InputTypes.ButtonInput key, Input.BooleanEventType type)
-