use of org.terasology.engine.input.lwjgl.LwjglControllerDevice in project Terasology by MovingBlocks.
the class LwjglInput method initControls.
private void initControls() {
Config config = context.get(Config.class);
InputSystem inputSystem = new InputSystem();
context.put(InputSystem.class, inputSystem);
inputSystem.setMouseDevice(new LwjglMouseDevice(config.getRendering()));
inputSystem.setKeyboardDevice(new LwjglKeyboardDevice());
ControllerConfig controllerConfig = config.getInput().getControllers();
LwjglControllerDevice controllerDevice = new LwjglControllerDevice(controllerConfig);
inputSystem.setControllerDevice(controllerDevice);
long window = GLFW.glfwGetCurrentContext();
((LwjglKeyboardDevice) inputSystem.getKeyboard()).registerToLwjglWindow(window);
((LwjglMouseDevice) inputSystem.getMouseDevice()).registerToLwjglWindow(window);
}
use of org.terasology.engine.input.lwjgl.LwjglControllerDevice in project Terasology by MovingBlocks.
the class AwtInput method initControls.
private void initControls() {
Config config = context.get(Config.class);
InputSystem inputSystem = new InputSystem();
context.put(InputSystem.class, inputSystem);
inputSystem.setMouseDevice(new AwtMouseDevice(config.getRendering()));
inputSystem.setKeyboardDevice(new AwtKeyboardDevice());
ControllerConfig controllerConfig = config.getInput().getControllers();
LwjglControllerDevice controllerDevice = new LwjglControllerDevice(controllerConfig);
inputSystem.setControllerDevice(controllerDevice);
}
Aggregations