Package gaiasky.gui

Class NaturalControllerListener

java.lang.Object
gaiasky.gui.NaturalControllerListener
All Implemented Interfaces:
com.badlogic.gdx.controllers.ControllerListener, IObserver, IInputListener

public class NaturalControllerListener extends Object implements com.badlogic.gdx.controllers.ControllerListener, IObserver, IInputListener
  • Constructor Details

    • NaturalControllerListener

      public NaturalControllerListener(NaturalCamera cam, String mappingsFile)
  • 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

      public IControllerMappings getMappings()
    • updateControllerMappings

      public boolean updateControllerMappings(String mappingsFile)
    • connected

      public void connected(com.badlogic.gdx.controllers.Controller controller)
      Specified by:
      connected in interface com.badlogic.gdx.controllers.ControllerListener
    • disconnected

      public void disconnected(com.badlogic.gdx.controllers.Controller controller)
      Specified by:
      disconnected in interface com.badlogic.gdx.controllers.ControllerListener
    • buttonDown

      public boolean buttonDown(com.badlogic.gdx.controllers.Controller controller, int buttonCode)
      Specified by:
      buttonDown in interface com.badlogic.gdx.controllers.ControllerListener
    • buttonUp

      public boolean buttonUp(com.badlogic.gdx.controllers.Controller controller, int buttonCode)
      Specified by:
      buttonUp in interface com.badlogic.gdx.controllers.ControllerListener
    • axisMoved

      public boolean axisMoved(com.badlogic.gdx.controllers.Controller controller, int axisCode, float value)
      Specified by:
      axisMoved in interface com.badlogic.gdx.controllers.ControllerListener
    • notify

      public void notify(Event event, Object source, Object... data)
      Description copied from interface: IObserver
      Event notification call.
      Specified by:
      notify in interface IObserver
      Parameters:
      event - The event type.
      source - The source object, if any.
      data - The data associated with this event.
    • update

      public void update()
      Specified by:
      update in interface IInputListener
    • activate

      public void activate()
      Specified by:
      activate in interface IInputListener
    • deactivate

      public void deactivate()
      Specified by:
      deactivate in interface IInputListener