public class InputMultiplexer extends java.lang.Object implements InputProcessor
InputProcessor that delegates to an ordered list of other InputProcessors. Delegation for an event stops if a
processor returns true, which indicates that the event was handled.| Constructor and Description |
|---|
InputMultiplexer() |
InputMultiplexer(InputProcessor... processors) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProcessor(InputProcessor processor) |
void |
addProcessor(int index,
InputProcessor processor) |
void |
clear() |
Array<InputProcessor> |
getProcessors() |
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.
|
void |
removeProcessor(InputProcessor processor) |
void |
removeProcessor(int index) |
boolean |
scrolled(int amount)
Called when the mouse wheel was scrolled.
|
void |
setProcessors(Array<InputProcessor> processors) |
int |
size() |
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.
|
public InputMultiplexer()
public InputMultiplexer(InputProcessor... processors)
public void addProcessor(int index,
InputProcessor processor)
public void removeProcessor(int index)
public void addProcessor(InputProcessor processor)
public void removeProcessor(InputProcessor processor)
public int size()
public void clear()
public void setProcessors(Array<InputProcessor> processors)
public Array<InputProcessor> getProcessors()
public boolean keyDown(int keycode)
InputProcessorkeyDown in interface InputProcessorkeycode - one of the constants in Input.Keyspublic boolean keyUp(int keycode)
InputProcessorkeyUp in interface InputProcessorkeycode - one of the constants in Input.Keyspublic boolean keyTyped(char character)
InputProcessorkeyTyped in interface InputProcessorcharacter - The characterpublic boolean touchDown(int screenX,
int screenY,
int pointer,
int button)
InputProcessorInput.Buttons.LEFT on iOS.touchDown in interface InputProcessorscreenX - 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 buttonpublic boolean touchUp(int screenX,
int screenY,
int pointer,
int button)
InputProcessorInput.Buttons.LEFT on iOS.touchUp in interface InputProcessorpointer - the pointer for the event.button - the buttonpublic boolean touchDragged(int screenX,
int screenY,
int pointer)
InputProcessortouchDragged in interface InputProcessorpointer - the pointer for the event.public boolean mouseMoved(int screenX,
int screenY)
InputProcessormouseMoved in interface InputProcessorpublic boolean scrolled(int amount)
InputProcessorscrolled in interface InputProcessoramount - the scroll amount, -1 or 1 depending on the direction the wheel was scrolled.