Package gaiasky.input

Class AbstractMouseKbdListener

java.lang.Object
com.badlogic.gdx.InputAdapter
com.badlogic.gdx.input.GestureDetector
gaiasky.input.AbstractMouseKbdListener
All Implemented Interfaces:
com.badlogic.gdx.InputProcessor, IInputListener
Direct Known Subclasses:
GameMouseKbdListener, GuiKbdListener, MainMouseKbdListener, SpacecraftMouseKbdListener

public abstract class AbstractMouseKbdListener extends com.badlogic.gdx.input.GestureDetector implements IInputListener
  • Nested Class Summary Link icon

    Nested classes/interfaces inherited from class com.badlogic.gdx.input.GestureDetector Link icon

    com.badlogic.gdx.input.GestureDetector.GestureAdapter, com.badlogic.gdx.input.GestureDetector.GestureListener
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    protected final AtomicBoolean
     
    protected ICamera
     
    protected long
     
    protected long
     
    protected long
     
  • Constructor Summary Link icon

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractMouseKbdListener(com.badlogic.gdx.input.GestureDetector.GestureListener gl, ICamera camera)
     
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    Activate the listener.
    boolean
    allPressed(int... keys)
    Returns true if all keys are pressed
    boolean
     
    boolean
    anyPressed(int... keys)
    Returns true if any of the physical keys are pressed.
    boolean
    anyPressedLogical(int... keys)
    Same as anyPressed(int...), but converts the physical keys to logical keys first.
    void
    Deactivate the listener.
    protected float
     
    float
     
    boolean
     
    boolean
    isKeyPressed(int keyCode)
    Returns whether the key is pressed.
    boolean
    isLogicalKeyPressed(int keyCode)
    Returns whether the given logical key code is pressed.
    boolean
    keyDown(int keyCode)
     
    boolean
    keyUp(int keyCode)
     
    protected abstract boolean
    Implement key polling here.
    boolean
    scrolled(float amountX, float amountY)
     
    boolean
    touchDown(float x, float y, int pointer, int button)
     
    boolean
    touchDown(int x, int y, int pointer, int button)
     
    boolean
    touchUp(float x, float y, int pointer, int button)
     
    boolean
    touchUp(int x, int y, int pointer, int button)
     
    void
    Update the listener.

    Methods inherited from class com.badlogic.gdx.input.GestureDetector Link icon

    cancel, invalidateTapSquare, isLongPressed, isLongPressed, isPanning, reset, setLongPressSeconds, setMaxFlingDelay, setTapCountInterval, setTapRectangleSize, setTapSquareSize, touchCancelled, touchDragged, touchDragged

    Methods inherited from class com.badlogic.gdx.InputAdapter Link icon

    keyTyped, mouseMoved

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details Link icon

    • active Link icon

      protected final AtomicBoolean active
    • iCamera Link icon

      protected ICamera iCamera
    • minPollTime Link icon

      protected long minPollTime
    • minPollInterval Link icon

      protected long minPollInterval
    • lastPollTime Link icon

      protected long lastPollTime
  • Constructor Details Link icon

    • AbstractMouseKbdListener Link icon

      protected AbstractMouseKbdListener(com.badlogic.gdx.input.GestureDetector.GestureListener gl, ICamera camera)
  • Method Details Link icon

    • keyDown Link icon

      public boolean keyDown(int keyCode)
      Specified by:
      keyDown in interface com.badlogic.gdx.InputProcessor
      Overrides:
      keyDown in class com.badlogic.gdx.InputAdapter
    • keyUp Link icon

      public boolean keyUp(int keyCode)
      Specified by:
      keyUp in interface com.badlogic.gdx.InputProcessor
      Overrides:
      keyUp in class com.badlogic.gdx.InputAdapter
    • isKeyPressed Link icon

      public boolean isKeyPressed(int keyCode)
      Returns whether the key is pressed.
      Parameters:
      keyCode - The key code as found in Input.Keys.
      Returns:
      true or false.
    • isLogicalKeyPressed Link icon

      public boolean isLogicalKeyPressed(int keyCode)
      Returns whether the given logical key code is pressed.
      Parameters:
      keyCode - The logical key code as found in Input.Keys.
      Returns:
      true or false.
    • allPressed Link icon

      public boolean allPressed(int... keys)
      Returns true if all keys are pressed
      Parameters:
      keys - The keys to test
      Returns:
      True if all are pressed
    • allPressed Link icon

      public boolean allPressed(Collection<Integer> keys)
    • anyPressed Link icon

      public boolean anyPressed(int... keys)
      Returns true if any of the physical keys are pressed.
      Parameters:
      keys - The keys to test.
      Returns:
      True if any physical keys are pressed.
    • anyPressedLogical Link icon

      public boolean anyPressedLogical(int... keys)
      Same as anyPressed(int...), but converts the physical keys to logical keys first.
      Parameters:
      keys - The logical keys.
      Returns:
      Whether any of the keys are pressed.
    • getResponseTime Link icon

      public float getResponseTime()
    • update Link icon

      public void update()
      Description copied from interface: IInputListener
      Update the listener.
      Specified by:
      update in interface IInputListener
    • touchUp Link icon

      public boolean touchUp(float x, float y, int pointer, int button)
      Overrides:
      touchUp in class com.badlogic.gdx.input.GestureDetector
    • touchUp Link icon

      public boolean touchUp(int x, int y, int pointer, int button)
      Specified by:
      touchUp in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchUp in class com.badlogic.gdx.input.GestureDetector
    • touchDown Link icon

      public boolean touchDown(float x, float y, int pointer, int button)
      Overrides:
      touchDown in class com.badlogic.gdx.input.GestureDetector
    • touchDown Link icon

      public boolean touchDown(int x, int y, int pointer, int button)
      Specified by:
      touchDown in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchDown in class com.badlogic.gdx.input.GestureDetector
    • scrolled Link icon

      public boolean scrolled(float amountX, float amountY)
      Specified by:
      scrolled in interface com.badlogic.gdx.InputProcessor
      Overrides:
      scrolled in class com.badlogic.gdx.InputAdapter
    • pollKeys Link icon

      protected abstract boolean pollKeys()
      Implement key polling here.
      Returns:
      True if an action was successfully executed.
    • isActive Link icon

      public boolean isActive()
    • activate Link icon

      public void activate()
      Description copied from interface: IInputListener
      Activate the listener.
      Specified by:
      activate in interface IInputListener
    • deactivate Link icon

      public void deactivate()
      Description copied from interface: IInputListener
      Deactivate the listener.
      Specified by:
      deactivate in interface IInputListener
    • getFpsScale Link icon

      protected float getFpsScale()