Package gaiasky.interfce
Class NaturalControllerListener
- java.lang.Object
-
- gaiasky.interfce.NaturalControllerListener
-
- All Implemented Interfaces:
com.badlogic.gdx.controllers.ControllerListener
,IObserver
,IInputListener
public class NaturalControllerListener extends java.lang.Object implements com.badlogic.gdx.controllers.ControllerListener, IObserver, IInputListener
-
-
Constructor Summary
Constructors Constructor Description NaturalControllerListener(NaturalCamera cam, java.lang.String mappingsFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accelerometerMoved(com.badlogic.gdx.controllers.Controller controller, int accelerometerCode, com.badlogic.gdx.math.Vector3 value)
void
activate()
void
addPressedKey(int keycode)
boolean
allPressed(int... keys)
Returns true if all keys are pressedboolean
anyPressed(int... keys)
Returns true if any of the keys are pressedboolean
axisMoved(com.badlogic.gdx.controllers.Controller controller, int axisCode, float value)
boolean
buttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode)
boolean
buttonUp(com.badlogic.gdx.controllers.Controller controller, int buttonCode)
void
connected(com.badlogic.gdx.controllers.Controller controller)
void
deactivate()
void
disconnected(com.badlogic.gdx.controllers.Controller controller)
boolean
isKeyPressed(int keycode)
void
notify(Events event, java.lang.Object... data)
boolean
povMoved(com.badlogic.gdx.controllers.Controller controller, int povCode, com.badlogic.gdx.controllers.PovDirection value)
void
removePressedKey(int keycode)
void
update()
boolean
updateControllerMappings(java.lang.String mappingsFile)
boolean
xSliderMoved(com.badlogic.gdx.controllers.Controller controller, int sliderCode, boolean value)
boolean
ySliderMoved(com.badlogic.gdx.controllers.Controller controller, int sliderCode, boolean value)
-
-
-
Constructor Detail
-
NaturalControllerListener
public NaturalControllerListener(NaturalCamera cam, java.lang.String mappingsFile)
-
-
Method Detail
-
addPressedKey
public void addPressedKey(int keycode)
-
removePressedKey
public void removePressedKey(int keycode)
-
isKeyPressed
public boolean isKeyPressed(int keycode)
-
allPressed
public boolean allPressed(int... keys)
Returns true if all keys are pressed- Parameters:
keys
- The keys to test- Returns:
- True if all are pressed
-
anyPressed
public boolean anyPressed(int... keys)
Returns true if any of the keys are pressed- Parameters:
keys
- The keys to test- Returns:
- True if any is pressed
-
updateControllerMappings
public boolean updateControllerMappings(java.lang.String mappingsFile)
-
connected
public void connected(com.badlogic.gdx.controllers.Controller controller)
- Specified by:
connected
in interfacecom.badlogic.gdx.controllers.ControllerListener
-
disconnected
public void disconnected(com.badlogic.gdx.controllers.Controller controller)
- Specified by:
disconnected
in interfacecom.badlogic.gdx.controllers.ControllerListener
-
buttonDown
public boolean buttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode)
- Specified by:
buttonDown
in interfacecom.badlogic.gdx.controllers.ControllerListener
-
buttonUp
public boolean buttonUp(com.badlogic.gdx.controllers.Controller controller, int buttonCode)
- Specified by:
buttonUp
in interfacecom.badlogic.gdx.controllers.ControllerListener
-
axisMoved
public boolean axisMoved(com.badlogic.gdx.controllers.Controller controller, int axisCode, float value)
- Specified by:
axisMoved
in interfacecom.badlogic.gdx.controllers.ControllerListener
-
povMoved
public boolean povMoved(com.badlogic.gdx.controllers.Controller controller, int povCode, com.badlogic.gdx.controllers.PovDirection value)
- Specified by:
povMoved
in interfacecom.badlogic.gdx.controllers.ControllerListener
-
xSliderMoved
public boolean xSliderMoved(com.badlogic.gdx.controllers.Controller controller, int sliderCode, boolean value)
- Specified by:
xSliderMoved
in interfacecom.badlogic.gdx.controllers.ControllerListener
-
ySliderMoved
public boolean ySliderMoved(com.badlogic.gdx.controllers.Controller controller, int sliderCode, boolean value)
- Specified by:
ySliderMoved
in interfacecom.badlogic.gdx.controllers.ControllerListener
-
accelerometerMoved
public boolean accelerometerMoved(com.badlogic.gdx.controllers.Controller controller, int accelerometerCode, com.badlogic.gdx.math.Vector3 value)
- Specified by:
accelerometerMoved
in interfacecom.badlogic.gdx.controllers.ControllerListener
-
notify
public void notify(Events event, java.lang.Object... data)
-
update
public void update()
- Specified by:
update
in interfaceIInputListener
-
activate
public void activate()
- Specified by:
activate
in interfaceIInputListener
-
deactivate
public void deactivate()
- Specified by:
deactivate
in interfaceIInputListener
-
-