Class SpacecraftGamepadListener
java.lang.Object
gaiasky.input.AbstractGamepadListener
gaiasky.input.SpacecraftGamepadListener
- All Implemented Interfaces:
com.badlogic.gdx.controllers.ControllerListener, IObserver, IInputListener
-
Field Summary
Fields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaxisMoved(com.badlogic.gdx.controllers.Controller controller, int axisCode, float value) booleanbuttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode) booleanbuttonUp(com.badlogic.gdx.controllers.Controller controller, int buttonCode) booleanpollAxes()Polls the axes.booleanPolls the buttons.voidupdate()Update the listener.Methods inherited from class AbstractGamepadListener
activate, anyPressed, anyPressed, applyZeroPoint, connected, deactivate, disconnected, getMappings, isActive, isKeyPressed, isKeyPressed, notify, setMappingsModifier 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.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.
-
Constructor Details
-
SpacecraftGamepadListener
-
-
Method Details
-
pollAxes
public boolean pollAxes()Description copied from class:AbstractGamepadListenerPolls the axes.- Specified by:
pollAxesin classAbstractGamepadListener- Returns:
- True if the axes were processed, false otherwise.
-
pollButtons
public boolean pollButtons()Description copied from class:AbstractGamepadListenerPolls the buttons.- Specified by:
pollButtonsin classAbstractGamepadListener- Returns:
- True if the buttons were processed, false otherwise.
-
update
public void update()Description copied from interface:IInputListenerUpdate the listener.- Specified by:
updatein interfaceIInputListener- Overrides:
updatein classAbstractGamepadListener
-
buttonDown
public boolean buttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode) - Specified by:
buttonDownin interfacecom.badlogic.gdx.controllers.ControllerListener- Overrides:
buttonDownin classAbstractGamepadListener
-
buttonUp
public boolean buttonUp(com.badlogic.gdx.controllers.Controller controller, int buttonCode) - Specified by:
buttonUpin interfacecom.badlogic.gdx.controllers.ControllerListener- Overrides:
buttonUpin 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
-