Package gaiasky.input
Class GuiGamepadListener
java.lang.Object
gaiasky.input.AbstractGamepadListener
gaiasky.input.GuiGamepadListener
- All Implemented Interfaces:
com.badlogic.gdx.controllers.ControllerListener
,IObserver
,IInputListener
- Direct Known Subclasses:
WindowGamepadListener
A gamepad listener for GUI elements like windows and panes.
-
Field Summary
Fields inherited from class gaiasky.input.AbstractGamepadListener
active, axisEventDelay, axisPollDelay, buttonPollDelay, em, lastAxisEvtTime, lastButtonPollTime, lastControllerUsed, mappings, MIN_ZERO_POINT
-
Constructor Summary
ConstructorDescriptionGuiGamepadListener
(IGamepadMappings mappings, com.badlogic.gdx.scenes.scene2d.Stage stage) GuiGamepadListener
(String mappingsFile, com.badlogic.gdx.scenes.scene2d.Stage stage) -
Method Summary
Modifier and TypeMethodDescriptionvoid
By default, the main action acts on the keyboard focus actor by firing a change event or checking it, if it is a checkbox.boolean
axisMoved
(com.badlogic.gdx.controllers.Controller controller, int axisCode, float value) abstract void
back()
boolean
buttonDown
(com.badlogic.gdx.controllers.Controller controller, int buttonCode) com.badlogic.gdx.utils.Array
<com.badlogic.gdx.scenes.scene2d.Group> void
moveDown()
Moves the focus down.void
moveFocusVertical
(boolean up) abstract void
moveLeft()
abstract void
void
moveUp()
Moves the focus up.boolean
pollAxes()
boolean
void
rightStickHorizontal
(float value) By default, the horizontal right stick does: Move sliders right and left.protected void
rightStickHorizontal
(com.badlogic.gdx.scenes.scene2d.Actor focus, float value) void
rightStickVertical
(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 void
rightStickVertical
(com.badlogic.gdx.scenes.scene2d.Actor focus, float value) abstract void
select()
abstract void
start()
abstract void
tabLeft()
abstract void
tabRight()
Methods inherited from class gaiasky.input.AbstractGamepadListener
activate, anyPressed, anyPressed, applyZeroPoint, buttonUp, connected, deactivate, disconnected, getMappings, isActive, isKeyPressed, isKeyPressed, notify, setMappings, update
-
Field Details
-
stage
protected final com.badlogic.gdx.scenes.scene2d.Stage stage
-
-
Constructor Details
-
GuiGamepadListener
-
GuiGamepadListener
-
-
Method Details
-
buttonDown
public boolean buttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode) - Specified by:
buttonDown
in interfacecom.badlogic.gdx.controllers.ControllerListener
- Overrides:
buttonDown
in classAbstractGamepadListener
-
axisMoved
public boolean axisMoved(com.badlogic.gdx.controllers.Controller controller, int axisCode, float value) - Specified by:
axisMoved
in interfacecom.badlogic.gdx.controllers.ControllerListener
- Overrides:
axisMoved
in classAbstractGamepadListener
-
pollAxes
public boolean pollAxes()- Specified by:
pollAxes
in classAbstractGamepadListener
-
pollButtons
public boolean pollButtons()- Specified by:
pollButtons
in classAbstractGamepadListener
-
getContentContainers
public com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Group> getContentContainers() -
actionDown
public void actionDown()By default, the main action acts on the keyboard focus actor by firing a change event or checking it, if it is a checkbox. -
back
public abstract void back() -
start
public abstract void start() -
select
public abstract void select() -
tabLeft
public abstract void tabLeft() -
tabRight
public abstract void tabRight() -
moveLeft
public abstract void moveLeft() -
moveRight
public abstract void moveRight() -
moveUp
public void moveUp()Moves the focus up. -
moveDown
public void moveDown()Moves the focus down. -
moveFocusVertical
public void moveFocusVertical(boolean up) -
rightStickVertical
public void rightStickVertical(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.
- Parameters:
value
- The axis value.
-
rightStickVertical
protected void rightStickVertical(com.badlogic.gdx.scenes.scene2d.Actor focus, float value) -
rightStickHorizontal
public void rightStickHorizontal(float value) By default, the horizontal right stick does:- Move sliders right and left.
- Parameters:
value
- The axis value.
-
rightStickHorizontal
protected void rightStickHorizontal(com.badlogic.gdx.scenes.scene2d.Actor focus, float value)
-