Class InputFilteredAction
java.lang.Object
com.blackrook.gui.action.InputFilteredAction
- All Implemented Interfaces:
GUIAction
An action that validates HOW it was activated before it is actually called.
This is meant to be attached to more than one type of event, especially if
mouse, gamepad, and keyboard keys are used for validation.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic InputFilteredAction.AxisTapaxisTap(int axisId, boolean positive) Creates a new axis tap.final voidThe method stub called when this action is invoked.static InputFilteredActionCreates a new input-filtered action.setCodes(int... codes) Adds a "valid" generic code to this action.setGamepadAxisTaps(InputFilteredAction.AxisTap... axisTaps) Adds a "valid" gamepad axis tap to this action.setGamepadButtons(int... buttons) Adds a "valid" gamepad button to this action.setKeyCodes(int... keyCodes) Adds a "valid" key code to this action.setMouseButtons(int... buttons) Adds a "valid" mouse button to this action.
-
Method Details
-
create
Creates a new input-filtered action.- Parameters:
action- the action to call after the input is validated.- Returns:
- a new filtered action.
-
axisTap
Creates a new axis tap.- Parameters:
axisId- the axis id.positive- true if positive axis direction, false if negative.- Returns:
- a new axis tap.
-
setCodes
Adds a "valid" generic code to this action. Codes are user defined and can be anything.- Parameters:
codes- the generic codes to add.- Returns:
- itself, for call chaining.
-
setKeyCodes
Adds a "valid" key code to this action. Key codes are defined by the ones inGUIInputConstants.- Parameters:
keyCodes- the key codes to add.- Returns:
- itself, for call chaining.
-
setMouseButtons
Adds a "valid" mouse button to this action. Mouse buttons are defined by the ones inGUIInputConstants.- Parameters:
buttons- the mouse buttons to add.- Returns:
- itself, for call chaining.
-
setGamepadButtons
Adds a "valid" gamepad button to this action. Gamepad buttons are defined by the ones inGUIInputConstants. the equivalents inGUIInputConstants.- Parameters:
buttons- the gamepad buttons to add.- Returns:
- itself, for call chaining.
-
setGamepadAxisTaps
Adds a "valid" gamepad axis tap to this action. Gamepad axes are defined by the ones inGUIInputConstants. the equivalents inGUIInputConstants.- Parameters:
axisTaps- the axis taps to set.- Returns:
- itself, for call chaining.
-
call
-