public interface InputProcessor
Input.setInputProcessor(InputProcessor)
method. It will be called each frame before the
call to ApplicationListener.render()
. Each method returns a boolean in case you want to use this with the
InputMultiplexer
to chain input processors.Modifier and Type | Method and Description |
---|---|
boolean |
keyDown(int keycode)
Called when a key was pressed
|
boolean |
keyTyped(char character)
Called when a key was typed
|
boolean |
keyUp(int keycode)
Called when a key was released
|
boolean |
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.
|
boolean keyDown(int keycode)
keycode
- one of the constants in Input.Keys
boolean keyUp(int keycode)
keycode
- one of the constants in Input.Keys
boolean keyTyped(char character)
character
- The characterboolean touchDown(int screenX, int screenY, int pointer, int button)
Input.Buttons.LEFT
on iOS.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 buttonboolean touchUp(int screenX, int screenY, int pointer, int button)
Input.Buttons.LEFT
on iOS.pointer
- the pointer for the event.button
- the buttonboolean touchDragged(int screenX, int screenY, int pointer)
pointer
- the pointer for the event.boolean mouseMoved(int screenX, int screenY)
boolean scrolled(float amountX, float amountY)
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.