Search in sources :

Example 1 with AwtKeyboardDevice

use of org.terasology.editor.input.AwtKeyboardDevice in project Terasology by MovingBlocks.

the class LwjglPortlet method initInputs.

public void initInputs() {
    final InputSystem inputSystem = context.get(InputSystem.class);
    Preconditions.checkNotNull(inputSystem);
    mouseDevice = ((AwtMouseDevice) inputSystem.getMouseDevice());
    mouseDevice.registerToAwtGlCanvas(canvas);
    ((AwtKeyboardDevice) inputSystem.getKeyboard()).registerToAwtGlCanvas(canvas);
}
Also used : AwtMouseDevice(org.terasology.editor.input.AwtMouseDevice) InputSystem(org.terasology.engine.input.InputSystem) AwtKeyboardDevice(org.terasology.editor.input.AwtKeyboardDevice)

Example 2 with AwtKeyboardDevice

use of org.terasology.editor.input.AwtKeyboardDevice 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);
}
Also used : AwtMouseDevice(org.terasology.editor.input.AwtMouseDevice) ControllerConfig(org.terasology.engine.config.ControllerConfig) LwjglControllerDevice(org.terasology.engine.input.lwjgl.LwjglControllerDevice) Config(org.terasology.engine.config.Config) ControllerConfig(org.terasology.engine.config.ControllerConfig) InputSystem(org.terasology.engine.input.InputSystem) AwtKeyboardDevice(org.terasology.editor.input.AwtKeyboardDevice)

Aggregations

AwtKeyboardDevice (org.terasology.editor.input.AwtKeyboardDevice)2 AwtMouseDevice (org.terasology.editor.input.AwtMouseDevice)2 InputSystem (org.terasology.engine.input.InputSystem)2 Config (org.terasology.engine.config.Config)1 ControllerConfig (org.terasology.engine.config.ControllerConfig)1 LwjglControllerDevice (org.terasology.engine.input.lwjgl.LwjglControllerDevice)1