Package com.ardor3d.input

Examples of com.ardor3d.input.InputState


        }));
    }

    private boolean offerKeyInputToUI(final TwoInputStates inputStates) {
        boolean consumed = false;
        final InputState current = inputStates.getCurrent();

        // Keyboard checks
        {
            final KeyboardState previousKState = inputStates.getPrevious().getKeyboardState();
            final KeyboardState currentKState = current.getKeyboardState();
            if (!currentKState.getKeysDown().isEmpty()) {
                // new presses
                final EnumSet<Key> pressed = currentKState.getKeysPressedSince(previousKState);
                if (!pressed.isEmpty()) {
                    for (final Key key : pressed) {
View Full Code Here


     *            our two InputState objects, detailing a before and after snapshot of the input system.
     * @return true if a UI element consumed the event described by inputStates.
     */
    private boolean offerMouseInputToUI(final TwoInputStates inputStates) {
        boolean consumed = false;
        final InputState current = inputStates.getCurrent();

        // Mouse checks.
        if (!isIgnoreMouseInputOnGrabbed() || _mouseManager == null
                || _mouseManager.getGrabbed() != GrabbedState.GRABBED) {
            final MouseState previousMState = inputStates.getPrevious().getMouseState();
            final MouseState currentMState = current.getMouseState();
            if (previousMState != currentMState) {

                // Check for presses.
                if (currentMState.hasButtonState(ButtonState.DOWN)) {
                    final EnumSet<MouseButton> pressed = currentMState.getButtonsPressedSince(previousMState);
View Full Code Here

            }
        }));

        logicalLayer.registerTrigger(new InputTrigger(new AnyKeyCondition(), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                final InputState current = inputStates.getCurrent();

                System.out.println("Key character pressed: " + current.getKeyboardState().getKeyEvent().getKeyChar());
            }
        }));
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.input.InputState

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.