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
FieldsFields inherited from class gaiasky.input.AbstractGamepadListener
active, axisEventDelay, axisPollDelay, buttonPollDelay, em, lastAxisEvtTime, lastButtonPollTime, lastControllerUsed, mappings, MIN_ZERO_POINT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGuiGamepadListener(IGamepadMappings mappings, com.badlogic.gdx.scenes.scene2d.Stage stage) protectedGuiGamepadListener(String mappingsFile, com.badlogic.gdx.scenes.scene2d.Stage stage) -
Method Summary
Modifier 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) abstract voidback()booleanbuttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode) com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Group> 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) abstract voidmoveLeft()abstract voidvoidmoveUp()Moves the focus up.booleanpollAxes()booleanvoidrightStickHorizontal(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) abstract voidselect()abstract voidstart()abstract voidtabLeft()abstract voidtabRight()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
protected GuiGamepadListener(IGamepadMappings mappings, com.badlogic.gdx.scenes.scene2d.Stage stage)
-
-
Method Details
-
buttonDown
public boolean buttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode) - Specified by:
buttonDownin interfacecom.badlogic.gdx.controllers.ControllerListener- Overrides:
buttonDownin classAbstractGamepadListener
-
axisMoved
public boolean axisMoved(com.badlogic.gdx.controllers.Controller controller, int axisCode, float value) - Specified by:
axisMovedin interfacecom.badlogic.gdx.controllers.ControllerListener- Overrides:
axisMovedin classAbstractGamepadListener
-
pollAxes
public boolean pollAxes()- Specified by:
pollAxesin classAbstractGamepadListener
-
pollButtons
public boolean pollButtons()- Specified by:
pollButtonsin 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.
- Move selection in select boxes.
- Parameters:
value- The axis value.
-
rightStickHorizontal
protected void rightStickHorizontal(com.badlogic.gdx.scenes.scene2d.Actor focus, float value) -
rightTrigger
protected void rightTrigger(float value) The right trigger does:- Move sliders right.
- Move selection in select boxes down.
- Parameters:
value- The axis value.
-
rightTrigger
protected void rightTrigger(com.badlogic.gdx.scenes.scene2d.Actor focus, float value) -
leftTrigger
protected void leftTrigger(float value) The left trigger does:- Move sliders left.
- Move selection in select boxes up.
- Parameters:
value- The axis value.
-
leftTrigger
protected void leftTrigger(com.badlogic.gdx.scenes.scene2d.Actor focus, float value)
-