Package com.csse3200.game.ui.terminal
Class KeyboardTerminalInputComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.ui.terminal.BaseTerminalInputComponent
com.csse3200.game.ui.terminal.KeyboardTerminalInputComponent
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener
,com.badlogic.gdx.InputProcessor
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.
-
Field Summary
Fields inherited from class com.csse3200.game.ui.terminal.BaseTerminalInputComponent
terminal
Fields inherited from class com.csse3200.game.input.InputComponent
priority
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
keyPressed
(int keycode) If the toggle key is pressed, the terminal will open / close.Methods inherited from class com.csse3200.game.ui.terminal.BaseTerminalInputComponent
create, isPauseable, keyReleased, keyTyped
Methods inherited from class com.csse3200.game.input.InputComponent
dispose, fling, getPriority, keyDown, keyUp, longPress, mouseMoved, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchDown, touchDown, touchDragged, touchUp, zoom
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
KeyboardTerminalInputComponent
public KeyboardTerminalInputComponent() -
KeyboardTerminalInputComponent
-
-
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 classBaseTerminalInputComponent
- Parameters:
keycode
- The key code of the key that was pressed.- Returns:
- whether the input was processed
- See Also:
-