Class ScreenGamepadListener
java.lang.Object
gaiasky.input.AbstractGamepadListener
gaiasky.input.GuiGamepadListener
gaiasky.input.ScreenGamepadListener
- All Implemented Interfaces:
com.badlogic.gdx.controllers.ControllerListener, IObserver, IInputListener
Listener that handles gamepad and joystick input events for UI screens and dialogs.
-
Field Summary
Fields inherited from class GuiGamepadListener
stageFields inherited from class AbstractGamepadListener
active, axisEventDelay, axisPollDelay, buttonPollDelay, em, lastAxisEvtTime, lastButtonPollTime, lastControllerUsed, mappings, MIN_ZERO_POINTModifier and TypeFieldDescriptionprotected final AtomicBooleanIs this listener active?protected longDelay between axis events.protected longDelay between axis poll operations.protected longDelay between button poll operations.protected final EventManagerReference to the global event manager.protected longLast axis event time.protected longLast button poll time.protected com.badlogic.gdx.controllers.ControllerReference to the last gaming controller that registered an input.protected IGamepadMappingsGamepad mappings instance.protected static final float -
Constructor Summary
ConstructorsConstructorDescriptionScreenGamepadListener(IGamepadMappings mappings, GenericDialog dialog) ScreenGamepadListener(String mappingsFile, IScreen dialog) -
Method Summary
Methods inherited from class GuiGamepadListener
actionDown, axisMoved, buttonDown, leftTrigger, leftTrigger, moveDown, moveFocusVertical, moveUp, pollAxes, pollButtons, rightStickHorizontal, rightStickHorizontal, rightStickVertical, rightStickVertical, rightTrigger, rightTriggerModifier and TypeMethodDescriptionvoidBy default, the main action acts on the keyboard focus actor by firing a change event or checking it, if it is a checkbox.booleanaxisMoved(com.badlogic.gdx.controllers.Controller controller, int axisCode, float value) booleanbuttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode) protected voidleftTrigger(float value) The left trigger does: Move sliders left. Move selection in select boxes up.protected voidleftTrigger(com.badlogic.gdx.scenes.scene2d.Actor focus, float value) voidmoveDown()Moves the focus down.voidmoveFocusVertical(boolean up) voidmoveUp()Moves the focus up.booleanpollAxes()Polls the axes.booleanPolls the buttons.voidrightStickHorizontal(float value) By default, the horizontal right stick does: Move sliders right and left. Move selection in select boxes.protected voidrightStickHorizontal(com.badlogic.gdx.scenes.scene2d.Actor focus, float value) voidrightStickVertical(float value) By default, the vertical right stick does: Change the selection in select boxes. Move the first scroll pane found in the content up and down.protected voidrightStickVertical(com.badlogic.gdx.scenes.scene2d.Actor focus, float value) protected voidrightTrigger(float value) The right trigger does: Move sliders right. Move selection in select boxes down.protected voidrightTrigger(com.badlogic.gdx.scenes.scene2d.Actor focus, float value) Methods inherited from class AbstractGamepadListener
activate, anyPressed, anyPressed, applyZeroPoint, buttonUp, connected, deactivate, disconnected, getMappings, isActive, isKeyPressed, isKeyPressed, notify, setMappings, updateModifier and TypeMethodDescriptionvoidactivate()Activate the listener.booleananyPressed(int... buttonCodes) Returns true if any of the buttons are pressed in the last controller used.booleananyPressed(com.badlogic.gdx.controllers.Controller controller, int... buttonCodes) Returns true if any of the buttons are pressed in the given controller.protected doubleapplyZeroPoint(double value) Zero-point function for the axes.booleanbuttonUp(com.badlogic.gdx.controllers.Controller controller, int buttonCode) voidconnected(com.badlogic.gdx.controllers.Controller controller) voidDeactivate the listener.voiddisconnected(com.badlogic.gdx.controllers.Controller controller) Get the mappings instance.booleanisActive()Is this listener active?booleanisKeyPressed(int buttonCode) Checks whether the button with the given code is pressed in the last controller used.booleanisKeyPressed(com.badlogic.gdx.controllers.Controller controller, int buttonCode) Returns if the given button in the given controller is pressed.voidEvent notification call.voidsetMappings(IGamepadMappings mappings) Sets the mappings.voidupdate()Update the listener.
-
Constructor Details
-
ScreenGamepadListener
-
ScreenGamepadListener
-
-
Method Details
-
moveLeft
public void moveLeft()- Specified by:
moveLeftin classGuiGamepadListener
-
moveRight
public void moveRight()- Specified by:
moveRightin classGuiGamepadListener
-
getContentContainers
public com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Group> getContentContainers()- Overrides:
getContentContainersin classGuiGamepadListener
-
select
public void select()- Specified by:
selectin classGuiGamepadListener
-
tabLeft
public void tabLeft()- Specified by:
tabLeftin classGuiGamepadListener
-
tabRight
public void tabRight()- Specified by:
tabRightin classGuiGamepadListener
-
back
public void back()- Specified by:
backin classGuiGamepadListener
-
start
public void start()- Specified by:
startin classGuiGamepadListener
-