APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx

public Class InputMultiplexer

extends Object
implements InputProcessor
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.InputProcessor
Imports
com.badlogic.gdx.utils.Array, .SnapshotArray

An 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.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
private SnapshotArray<InputProcessor>

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
addProcessor(int index, InputProcessor processor)

public void
public void
public SnapshotArray<InputProcessor>
public boolean
keyDown(int keycode)

Implements com.badlogic.gdx.InputProcessor.keyDown.

Called when a key was pressed

public boolean
keyTyped(char character)

Implements com.badlogic.gdx.InputProcessor.keyTyped.

Called when a key was typed

public boolean
keyUp(int keycode)

Implements com.badlogic.gdx.InputProcessor.keyUp.

Called when a key was released

public boolean
mouseMoved(int screenX, int screenY)

Implements com.badlogic.gdx.InputProcessor.mouseMoved.

Called when the mouse was moved without any buttons being pressed.

public void
removeProcessor(int index)

public void
public boolean
scrolled(float amountX, float amountY)

Implements com.badlogic.gdx.InputProcessor.scrolled.

Called when the mouse wheel was scrolled.

public void
public void
public int
size()

Returns: the number of processors in this multiplexer

public boolean
touchCancelled(int screenX, int screenY, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchCancelled.

Called when the touch gesture is cancelled.

public boolean
touchDown(int screenX, int screenY, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchDown.

Called when the screen was touched or a mouse button was pressed.

public boolean
touchDragged(int screenX, int screenY, int pointer)

Implements com.badlogic.gdx.InputProcessor.touchDragged.

Called when a finger or the mouse was dragged.

public boolean
touchUp(int screenX, int screenY, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchUp.

Called when a finger was lifted or a mouse button was released.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

processorsback to summary
private SnapshotArray<InputProcessor> processors

Constructor Detail

InputMultiplexerback to summary
public InputMultiplexer()
InputMultiplexerback to summary
public InputMultiplexer(InputProcessor... processors)

Method Detail

addProcessorback to summary
public void addProcessor(int index, InputProcessor processor)
addProcessorback to summary
public void addProcessor(InputProcessor processor)
clearback to summary
public void clear()
getProcessorsback to summary
public SnapshotArray<InputProcessor> getProcessors()
keyDownback to summary
public boolean keyDown(int keycode)

Implements com.badlogic.gdx.InputProcessor.keyDown.

Doc from com.badlogic.gdx.InputProcessor.keyDown.

Called when a key was pressed

keyTypedback to summary
public boolean keyTyped(char character)

Implements com.badlogic.gdx.InputProcessor.keyTyped.

Doc from com.badlogic.gdx.InputProcessor.keyTyped.

Called when a key was typed

keyUpback to summary
public boolean keyUp(int keycode)

Implements com.badlogic.gdx.InputProcessor.keyUp.

Doc from com.badlogic.gdx.InputProcessor.keyUp.

Called when a key was released

mouseMovedback to summary
public boolean mouseMoved(int screenX, int screenY)

Implements com.badlogic.gdx.InputProcessor.mouseMoved.

Doc from com.badlogic.gdx.InputProcessor.mouseMoved.

Called when the mouse was moved without any buttons being pressed. Will not be called on iOS.

removeProcessorback to summary
public void removeProcessor(int index)
removeProcessorback to summary
public void removeProcessor(InputProcessor processor)
scrolledback to summary
public boolean scrolled(float amountX, float amountY)

Implements com.badlogic.gdx.InputProcessor.scrolled.

Doc from com.badlogic.gdx.InputProcessor.scrolled.

Called when the mouse wheel was scrolled. Will not be called on iOS.

setProcessorsback to summary
public void setProcessors(InputProcessor... processors)
setProcessorsback to summary
public void setProcessors(Array<InputProcessor> processors)
sizeback to summary
public int size()
Returns:int

the number of processors in this multiplexer

touchCancelledback to summary
public boolean touchCancelled(int screenX, int screenY, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchCancelled.

Doc from com.badlogic.gdx.InputProcessor.touchCancelled.

Called when the touch gesture is cancelled. Reason may be from OS interruption to touch becoming a large surface such as the user cheek). Relevant on Android and iOS only. The button parameter will be Buttons#LEFT on iOS.

touchDownback to summary
public boolean touchDown(int screenX, int screenY, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchDown.

Doc from com.badlogic.gdx.InputProcessor.touchDown.

Called when the screen was touched or a mouse button was pressed. The button parameter will be Buttons#LEFT on iOS.

touchDraggedback to summary
public boolean touchDragged(int screenX, int screenY, int pointer)

Implements com.badlogic.gdx.InputProcessor.touchDragged.

Doc from com.badlogic.gdx.InputProcessor.touchDragged.

Called when a finger or the mouse was dragged.

touchUpback to summary
public boolean touchUp(int screenX, int screenY, int pointer, int button)

Implements com.badlogic.gdx.InputProcessor.touchUp.

Doc from com.badlogic.gdx.InputProcessor.touchUp.

Called when a finger was lifted or a mouse button was released. The button parameter will be Buttons#LEFT on iOS.