Class KeyboardTerminalInputComponent

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

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

The debug terminal can be opened and closed by pressing 'F1' and a message can be entered via the keyboard.

  • Constructor Details

    • KeyboardTerminalInputComponent

      public KeyboardTerminalInputComponent()
    • KeyboardTerminalInputComponent

      public KeyboardTerminalInputComponent(Terminal terminal)
  • Method Details

    • keyPressed

      public boolean keyPressed(int keycode)
      If the toggle key is pressed, the terminal will open / close.

      Otherwise, 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)