Class TouchTerminalInputComponent

All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener, com.badlogic.gdx.InputProcessor

public class TouchTerminalInputComponent extends BaseTerminalInputComponent
Input handler for the debug terminal for keyboard and touch (mouse) input. This input handler uses keyboard and touch input.

The debug terminal can be opened and closed by scrolling vertically and a message can be entered via the keyboard.

  • Constructor Details

    • TouchTerminalInputComponent

      public TouchTerminalInputComponent()
    • TouchTerminalInputComponent

      public TouchTerminalInputComponent(Terminal terminal)
  • Method Details

    • keyPressed

      public boolean keyPressed(int keycode)
      Handles input if the terminal is open. This is because keyDown events are triggered alongside keyTyped events. If the user is typing in the terminal, the input shouldn't trigger any other input handlers.
      Specified by:
      keyPressed in class BaseTerminalInputComponent
      Parameters:
      keycode - The key code of the key that was pressed.
      Returns:
      whether the input was processed
      See Also:
      • InputProcessor.keyDown(int)
    • scrolled

      public boolean scrolled(float amountX, float amountY)
      Scrolling up will open the terminal and scrolling down will close the terminal.
      Specified by:
      scrolled in interface com.badlogic.gdx.InputProcessor
      Overrides:
      scrolled in class InputComponent
      Returns:
      whether the input was processed
      See Also:
      • InputProcessor.scrolled(float, float)