Class KeyboardPlayerInputComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.input.InputComponent
com.deco2800.game.components.player.KeyboardPlayerInputComponent
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener,com.badlogic.gdx.InputProcessor
Input handler for the player for keyboard and touch (mouse) input.
This input handler only uses keyboard input.
-
Field Summary
FieldsFields inherited from class com.deco2800.game.input.InputComponent
priority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleankeyDown(int keycode) Triggers player events on specific keycodes.booleankeyUp(int keycode) Triggers player events on specific keycodes.booleanmouseMoved(int screenX, int screenY) booleantouchDown(int screenX, int screenY, int pointer, int button) booleantouchUp(int screenX, int screenY, int pointer, int button) Methods inherited from class com.deco2800.game.input.InputComponent
create, dispose, fling, getPriority, keyTyped, longPress, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchDown, touchDragged, zoomMethods inherited from class com.deco2800.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Field Details
-
EVENT_PLAYER_CONTROL_TUT
- See Also:
-
EVENT_REMOVE_NO_MINE
- See Also:
-
EVENT_WALK_REV
- See Also:
-
-
Constructor Details
-
KeyboardPlayerInputComponent
public KeyboardPlayerInputComponent()
-
-
Method Details
-
keyDown
public boolean keyDown(int keycode) Triggers player events on specific keycodes.- Specified by:
keyDownin interfacecom.badlogic.gdx.InputProcessor- Overrides:
keyDownin classInputComponent- Returns:
- whether the input was processed
- See Also:
-
InputProcessor.keyDown(int)
-
keyUp
public boolean keyUp(int keycode) Triggers player events on specific keycodes.- Specified by:
keyUpin interfacecom.badlogic.gdx.InputProcessor- Overrides:
keyUpin classInputComponent- Returns:
- whether the input was processed
- See Also:
-
InputProcessor.keyUp(int)
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button) - Specified by:
touchDownin interfacecom.badlogic.gdx.InputProcessor- Overrides:
touchDownin classInputComponent- See Also:
-
InputProcessor.touchDown(int, int, int, int)
-
mouseMoved
public boolean mouseMoved(int screenX, int screenY) - Specified by:
mouseMovedin interfacecom.badlogic.gdx.InputProcessor- Overrides:
mouseMovedin classInputComponent- See Also:
-
InputProcessor.mouseMoved(int, int)
-
touchUp
public boolean touchUp(int screenX, int screenY, int pointer, int button) - Specified by:
touchUpin interfacecom.badlogic.gdx.InputProcessor- Overrides:
touchUpin classInputComponent- See Also:
-
InputProcessor.touchUp(int, int, int, int)
-