use of org.terasology.config.ControllerConfig in project Terasology by MovingBlocks.
the class LwjglInput method initControls.
private void initControls() {
try {
Keyboard.create();
Keyboard.enableRepeatEvents(true);
Mouse.create();
InputSystem inputSystem = new InputSystem();
context.put(InputSystem.class, inputSystem);
inputSystem.setMouseDevice(new LwjglMouseDevice());
inputSystem.setKeyboardDevice(new LwjglKeyboardDevice());
ControllerConfig controllerConfig = context.get(Config.class).getInput().getControllers();
JInputControllerDevice controllerDevice = new JInputControllerDevice(controllerConfig);
inputSystem.setControllerDevice(controllerDevice);
} catch (LWJGLException e) {
throw new RuntimeException("Could not initialize controls.", e);
}
}
Aggregations