Package arc.input

Class InputEventQueue

java.lang.Object
arc.input.InputEventQueue
All Implemented Interfaces:
InputProcessor

public class InputEventQueue extends Object implements InputProcessor
Queues events that are later passed to the wrapped InputProcessor.
  • Constructor Details

    • InputEventQueue

      public InputEventQueue()
    • InputEventQueue

      public InputEventQueue(InputProcessor processor)
  • Method Details

    • getProcessor

      public InputProcessor getProcessor()
    • setProcessor

      public void setProcessor(InputProcessor processor)
    • drain

      public void drain()
    • keyDown

      public boolean keyDown(KeyCode key)
      Description copied from interface: InputProcessor
      Called when a key was pressed
      Specified by:
      keyDown in interface InputProcessor
      Returns:
      whether the input was processed
    • keyUp

      public boolean keyUp(KeyCode key)
      Description copied from interface: InputProcessor
      Called when a key was released
      Specified by:
      keyUp in interface InputProcessor
      Returns:
      whether the input was processed
    • keyTyped

      public boolean keyTyped(char character)
      Description copied from interface: InputProcessor
      Called when a key was typed
      Specified by:
      keyTyped in interface InputProcessor
      Parameters:
      character - The character
      Returns:
      whether the input was processed
    • touchDown

      public boolean touchDown(int screenX, int screenY, int pointer, KeyCode button)
      Specified by:
      touchDown in interface InputProcessor
      Parameters:
      screenX - The x coordinate, origin is in the upper left corner
      screenY - The y coordinate, origin is in the upper left corner
      pointer - the pointer for the event.
      button - the button
      Returns:
      whether the input was processed
    • touchUp

      public boolean touchUp(int screenX, int screenY, int pointer, KeyCode button)
      Specified by:
      touchUp in interface InputProcessor
      pointer - the pointer for the event.
      button - the button
      Returns:
      whether the input was processed
    • touchDragged

      public boolean touchDragged(int screenX, int screenY, int pointer)
      Description copied from interface: InputProcessor
      Called when a finger or the mouse was dragged.
      Specified by:
      touchDragged in interface InputProcessor
      pointer - the pointer for the event.
      Returns:
      whether the input was processed
    • mouseMoved

      public boolean mouseMoved(int screenX, int screenY)
      Specified by:
      mouseMoved in interface InputProcessor
      Returns:
      whether the input was processed
    • scrolled

      public boolean scrolled(float amountX, float amountY)
      Description copied from interface: InputProcessor
      Called when the mouse wheel was scrolled. Will not be called on iOS.
      Specified by:
      scrolled in interface InputProcessor
      Parameters:
      amountX - the horizontal scroll amount, negative or positive depending on the direction the wheel was scrolled.
      amountY - the vertical scroll amount, negative or positive depending on the direction the wheel was scrolled.
      Returns:
      whether the input was processed.
    • getCurrentEventTime

      public long getCurrentEventTime()