Package org.terasology.input.device

Examples of org.terasology.input.device.InputAction


            if (Keyboard.isRepeatEvent()) {
                state = ButtonState.REPEAT;
            } else {
                state = (Keyboard.getEventKeyState()) ? ButtonState.DOWN : ButtonState.UP;
            }
            result.add(new InputAction(InputType.KEY.getInput(Keyboard.getEventKey()), state, Keyboard.getEventCharacter()));
        }

        return result;
    }
View Full Code Here


        Queue<InputAction> result = Queues.newArrayDeque();

        while (Mouse.next()) {
            if (Mouse.getEventButton() != -1) {
                ButtonState state = (Mouse.getEventButtonState()) ? ButtonState.DOWN : ButtonState.UP;
                result.add(new InputAction(InputType.MOUSE_BUTTON.getInput(Mouse.getEventButton()), state, getPosition()));
            }
            if (Mouse.getEventDWheel() != 0) {
                int id = (Mouse.getEventDWheel() > 0) ? 1 : -1;
                result.add(new InputAction(InputType.MOUSE_WHEEL.getInput(id), id * Mouse.getEventDWheel() / 120, getPosition()));
            }
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of org.terasology.input.device.InputAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.