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

public Class InputAdapter

extends Object
implements InputProcessor
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.InputProcessor
Known Direct Subclasses
com.badlogic.gdx.graphics.g3d.utils.FirstPersonCameraController, com.badlogic.gdx.input.GestureDetector, com.badlogic.gdx.scenes.scene2d.Stage

An adapter class for InputProcessor. You can derive from this and only override what you are interested in.
Author
mzechner

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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 boolean
scrolled(float amountX, float amountY)

Implements com.badlogic.gdx.InputProcessor.scrolled.

Called when the mouse wheel was scrolled.

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

Constructor Detail

InputAdapterback to summary
public InputAdapter()

Method Detail

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.

Annotations
@Override
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.

Annotations
@Override
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.