Package arc.input
Interface InputProcessor
- All Known Implementing Classes:
DesktopInput
,GestureDetector
,InputEventQueue
,InputHandler
,InputMultiplexer
,KeyboardDevice
,MobileInput
,Scene
public interface InputProcessor
An InputProcessor is used to receive input events from the keyboard and the touch screen (mouse on the desktop). For this it
has to be registered with the
Input.addProcessor(InputProcessor)
method. It will be called each frame before the
call to ApplicationListener.update()
. Each method returns a boolean in case you want to use this with the
InputMultiplexer
to chain input processors.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
connected
(InputDevice device) Called when an input device is connected.default void
disconnected
(InputDevice device) Called when an input device is disconnected.default boolean
Called when a key was presseddefault boolean
keyTyped
(char character) Called when a key was typeddefault boolean
Called when a key was releaseddefault boolean
mouseMoved
(int screenX, int screenY) default boolean
scrolled
(float amountX, float amountY) Called when the mouse wheel was scrolled.default boolean
default boolean
touchDragged
(int screenX, int screenY, int pointer) Called when a finger or the mouse was dragged.default boolean
-
Method Details
-
connected
Called when an input device is connected. -
disconnected
Called when an input device is disconnected. -
keyDown
Called when a key was pressed- Returns:
- whether the input was processed
-
keyUp
Called when a key was released- Returns:
- whether the input was processed
-
keyTyped
default boolean keyTyped(char character) Called when a key was typed- Parameters:
character
- The character- Returns:
- whether the input was processed
-
touchDown
- 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
- Parameters:
pointer
- the pointer for the event.button
- the button- Returns:
- whether the input was processed
-
touchDragged
default boolean touchDragged(int screenX, int screenY, int pointer) Called when a finger or the mouse was dragged.- Parameters:
pointer
- the pointer for the event.- Returns:
- whether the input was processed
-
mouseMoved
default boolean mouseMoved(int screenX, int screenY) - Returns:
- whether the input was processed
-
scrolled
default boolean scrolled(float amountX, float amountY) Called when the mouse wheel was scrolled. Will not be called on iOS.- 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.
-