
com.kennycason.gdx.controller.KeyboardController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gdx-controller Show documentation
Show all versions of gdx-controller Show documentation
A library to help with controller management in LibGDX.
The newest version!
package com.kennycason.gdx.controller;
import com.badlogic.gdx.Gdx;
import com.kennycason.gdx.controller.controls.Controls;
import com.kennycason.gdx.controller.mapping.ButtonMapper;
/**
* Created by kenny on 5/22/15.
*
* A very basic keyboard controller implementation.
*/
public class KeyboardController extends Controller {
public KeyboardController(final ButtonMapper buttonMapper) {
super.buttonMapper = buttonMapper;
}
@Override
public boolean isPressed(V control) {
final boolean pressed = Gdx.input.isKeyPressed(buttonMapper.get(control));
if (pressed) { record(control); }
return pressed;
}
@Override
public float getAxis(V control) {
return 0f;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy