Package com.devcharles.piazzapanic.input
Class KeyboardInput
java.lang.Object
com.devcharles.piazzapanic.input.KeyboardInput
- All Implemented Interfaces:
com.badlogic.gdx.InputProcessor
-
Field Summary
Modifier and TypeFieldDescriptionboolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
keyDown
(int keycode) Called when a key was pressedboolean
keyTyped
(char character) Called when a key was typedboolean
keyUp
(int keycode) Called when a key was releasedboolean
mouseMoved
(int screenX, int screenY) Called when the mouse was moved without any buttons being pressed.boolean
scrolled
(float amountX, float amountY) Called when the mouse wheel was scrolled.boolean
touchDown
(int screenX, int screenY, int pointer, int button) Called when the screen was touched or a mouse button was pressed.boolean
touchDragged
(int screenX, int screenY, int pointer) Called when a finger or the mouse was dragged.boolean
touchUp
(int screenX, int screenY, int pointer, int button) Called when a finger was lifted or a mouse button was released.
-
Field Details
-
left
public boolean left -
right
public boolean right -
up
public boolean up -
down
public boolean down -
changeCooks
public boolean changeCooks -
putDown
public boolean putDown -
pickUp
public boolean pickUp -
interact
public boolean interact -
disableHud
public boolean disableHud
-
-
Constructor Details
-
KeyboardInput
public KeyboardInput()
-
-
Method Details
-
clearInputs
public void clearInputs() -
keyDown
public boolean keyDown(int keycode) Description copied from interface:com.badlogic.gdx.InputProcessor
Called when a key was pressed- Specified by:
keyDown
in interfacecom.badlogic.gdx.InputProcessor
- Parameters:
keycode
- one of the constants inInput.Keys
- Returns:
- whether the input was processed
-
keyUp
public boolean keyUp(int keycode) Description copied from interface:com.badlogic.gdx.InputProcessor
Called when a key was released- Specified by:
keyUp
in interfacecom.badlogic.gdx.InputProcessor
- Parameters:
keycode
- one of the constants inInput.Keys
- Returns:
- whether the input was processed
-
keyTyped
public boolean keyTyped(char character) Description copied from interface:com.badlogic.gdx.InputProcessor
Called when a key was typed- Specified by:
keyTyped
in interfacecom.badlogic.gdx.InputProcessor
- Parameters:
character
- The character- Returns:
- whether the input was processed
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button) Description copied from interface:com.badlogic.gdx.InputProcessor
Called when the screen was touched or a mouse button was pressed. The button parameter will beInput.Buttons.LEFT
on iOS.- Specified by:
touchDown
in interfacecom.badlogic.gdx.InputProcessor
- Parameters:
screenX
- The x coordinate, origin is in the upper left cornerscreenY
- The y coordinate, origin is in the upper left cornerpointer
- the pointer for the event.button
- the button- Returns:
- whether the input was processed
-
touchUp
public boolean touchUp(int screenX, int screenY, int pointer, int button) Description copied from interface:com.badlogic.gdx.InputProcessor
Called when a finger was lifted or a mouse button was released. The button parameter will beInput.Buttons.LEFT
on iOS.- Specified by:
touchUp
in interfacecom.badlogic.gdx.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:com.badlogic.gdx.InputProcessor
Called when a finger or the mouse was dragged.- Specified by:
touchDragged
in interfacecom.badlogic.gdx.InputProcessor
pointer
- the pointer for the event.- Returns:
- whether the input was processed
-
mouseMoved
public boolean mouseMoved(int screenX, int screenY) Description copied from interface:com.badlogic.gdx.InputProcessor
Called when the mouse was moved without any buttons being pressed. Will not be called on iOS.- Specified by:
mouseMoved
in interfacecom.badlogic.gdx.InputProcessor
- Returns:
- whether the input was processed
-
scrolled
public boolean scrolled(float amountX, float amountY) Description copied from interface:com.badlogic.gdx.InputProcessor
Called when the mouse wheel was scrolled. Will not be called on iOS.- Specified by:
scrolled
in interfacecom.badlogic.gdx.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.
-