Example usage for com.badlogic.gdx Input setInputProcessor

List of usage examples for com.badlogic.gdx Input setInputProcessor

Introduction

In this page you can find the example usage for com.badlogic.gdx Input setInputProcessor.

Prototype

public void setInputProcessor(InputProcessor processor);

Source Link

Document

Sets the InputProcessor that will receive all touch and key input events.

Usage

From source file:com.hot.ball.hotball.ui.UserInput.java

public static void create(Input input, KeyBinding keyBinding, ControlMode controlMode) {
    if (singleton != null) {
        throw new RuntimeException("UserInput already created!");
    }// w  w w. ja va 2 s . co  m
    singleton = new UserInput(keyBinding, controlMode);
    input.setInputProcessor(singleton);
}

From source file:org.illarion.engine.backend.gdx.GdxInput.java

License:Open Source License

/**
 * Create a new instance of the libGDX input system.
 *
 * @param gdxInput the input provider of libGDX that is supposed to be used
 *//*from  ww  w .  j  a  v a  2s.c  om*/
GdxInput(@Nonnull final Input gdxInput) {
    this.gdxInput = gdxInput;
    gdxInput.setInputProcessor(this);
    events = new LinkedList<Runnable>();
    Keyboard.enableRepeatEvents(true);
}