Package gaiasky.interafce
Class NaturalControllerListener
java.lang.Object
gaiasky.interafce.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
Modifier and Type Method Description voidactivate()voidaddPressedKey(int keycode)booleanallPressed(int... keys)Returns true if all keys are pressedbooleananyPressed(int... keys)Returns true if any of the keys are pressedbooleanaxisMoved(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)voidconnected(com.badlogic.gdx.controllers.Controller controller)voiddeactivate()voiddisconnected(com.badlogic.gdx.controllers.Controller controller)IControllerMappingsgetMappings()booleanisKeyPressed(int keycode)voidnotify(Events event, java.lang.Object... data)voidremovePressedKey(int keycode)voidupdate()booleanupdateControllerMappings(java.lang.String mappingsFile)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
NaturalControllerListener
-
-
Method Details
-
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
-
getMappings
-
updateControllerMappings
public boolean updateControllerMappings(java.lang.String mappingsFile) -
connected
public void connected(com.badlogic.gdx.controllers.Controller controller)- Specified by:
connectedin interfacecom.badlogic.gdx.controllers.ControllerListener
-
disconnected
public void disconnected(com.badlogic.gdx.controllers.Controller controller)- Specified by:
disconnectedin interfacecom.badlogic.gdx.controllers.ControllerListener
-
buttonDown
public boolean buttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode)- Specified by:
buttonDownin interfacecom.badlogic.gdx.controllers.ControllerListener
-
buttonUp
public boolean buttonUp(com.badlogic.gdx.controllers.Controller controller, int buttonCode)- Specified by:
buttonUpin interfacecom.badlogic.gdx.controllers.ControllerListener
-
axisMoved
public boolean axisMoved(com.badlogic.gdx.controllers.Controller controller, int axisCode, float value)- Specified by:
axisMovedin interfacecom.badlogic.gdx.controllers.ControllerListener
-
notify
-
update
public void update()- Specified by:
updatein interfaceIInputListener
-
activate
public void activate()- Specified by:
activatein interfaceIInputListener
-
deactivate
public void deactivate()- Specified by:
deactivatein interfaceIInputListener
-