Package com.badlogic.gdx

Examples of com.badlogic.gdx.InputProcessor


  }

  void processEvents () {
    synchronized (this) {
      if (processor != null) {
        InputProcessor processor = this.processor;
        int len = keyEvents.size();
        for (int i = 0; i < len; i++) {
          KeyEvent e = keyEvents.get(i);
          currentEventTimeStamp = e.timeStamp;
          switch (e.type) {
          case KeyEvent.KEY_DOWN:
            processor.keyDown(e.keyCode);
            break;
          case KeyEvent.KEY_UP:
            processor.keyUp(e.keyCode);
            break;
          case KeyEvent.KEY_TYPED:
            processor.keyTyped(e.keyChar);
          }
          usedKeyEvents.free(e);
        }

        len = touchEvents.size();
        for (int i = 0; i < len; i++) {
          TouchEvent e = touchEvents.get(i);
          currentEventTimeStamp = e.timeStamp;
          switch (e.type) {
          case TouchEvent.TOUCH_DOWN:
            processor.touchDown(e.x, e.y, e.pointer, e.button);
            break;
          case TouchEvent.TOUCH_UP:
            processor.touchUp(e.x, e.y, e.pointer, e.button);
            break;
          case TouchEvent.TOUCH_DRAGGED:
            processor.touchDragged(e.x, e.y, e.pointer);
            break;
          case TouchEvent.TOUCH_MOVED:
            processor.mouseMoved(e.x, e.y);
            break;
          case TouchEvent.TOUCH_SCROLLED:
            processor.scrolled(e.scrollAmount);
          }
          usedTouchEvents.free(e);
        }
      } else {
        int len = touchEvents.size();
View Full Code Here


          justPressedKeys[i] = false;
        }
      }

      if (processor != null) {
        InputProcessor processor = this.processor;

        int len = keyEvents.size();
        for (int i = 0; i < len; i++) {
          KeyEvent e = keyEvents.get(i);
          currentEventTimeStamp = e.timeStamp;
          switch (e.type) {
          case KeyEvent.KEY_DOWN:
            processor.keyDown(e.keyCode);
            keyJustPressed = true;
            justPressedKeys[e.keyCode] = true;
            break;
          case KeyEvent.KEY_UP:
            processor.keyUp(e.keyCode);
            break;
          case KeyEvent.KEY_TYPED:
            processor.keyTyped(e.keyChar);
          }
          usedKeyEvents.free(e);
        }

        len = touchEvents.size();
        for (int i = 0; i < len; i++) {
          TouchEvent e = touchEvents.get(i);
          currentEventTimeStamp = e.timeStamp;
          switch (e.type) {
          case TouchEvent.TOUCH_DOWN:
            processor.touchDown(e.x, e.y, e.pointer, e.button);
            justTouched = true;
            break;
          case TouchEvent.TOUCH_UP:
            processor.touchUp(e.x, e.y, e.pointer, e.button);
            break;
          case TouchEvent.TOUCH_DRAGGED:
            processor.touchDragged(e.x, e.y, e.pointer);
            break;
          case TouchEvent.TOUCH_MOVED:
            processor.mouseMoved(e.x, e.y);
            break;
          case TouchEvent.TOUCH_SCROLLED:
            processor.scrolled(e.scrollAmount);
            break;
          }
          usedTouchEvents.free(e);
        }
      } else {
View Full Code Here

  long currentEventTime;

  public JglfwInput (final JglfwApplication app, boolean queueEvents) {
    this.app = app;

    InputProcessor inputProcessor = new InputProcessor() {
      private int mouseX, mouseY;

      public boolean keyDown (int keycode) {
        pressedKeys++;
        keyJustPressed = true;
View Full Code Here

  long currentEventTime;

  public JglfwInput (final JglfwApplication app, boolean queueEvents) {
    this.app = app;

    InputProcessor inputProcessor = new InputProcessor() {
      private int mouseX, mouseY;

      public boolean keyDown (int keycode) {
        pressedKeys++;
        app.graphics.requestRendering();
View Full Code Here

  }

  void processEvents () {
    synchronized (this) {
      if (processor != null) {
        InputProcessor processor = this.processor;
        int len = keyEvents.size();
        for (int i = 0; i < len; i++) {
          KeyEvent e = keyEvents.get(i);
          currentEventTimeStamp = e.timeStamp;
          switch (e.type) {
          case KeyEvent.KEY_DOWN:
            processor.keyDown(e.keyCode);
            break;
          case KeyEvent.KEY_UP:
            processor.keyUp(e.keyCode);
            break;
          case KeyEvent.KEY_TYPED:
            processor.keyTyped(e.keyChar);
          }
          usedKeyEvents.free(e);
        }

        len = touchEvents.size();
        for (int i = 0; i < len; i++) {
          TouchEvent e = touchEvents.get(i);
          currentEventTimeStamp = e.timeStamp;
          switch (e.type) {
          case TouchEvent.TOUCH_DOWN:
            processor.touchDown(e.x, e.y, e.pointer, e.button);
            break;
          case TouchEvent.TOUCH_UP:
            processor.touchUp(e.x, e.y, e.pointer, e.button);
            break;
          case TouchEvent.TOUCH_DRAGGED:
            processor.touchDragged(e.x, e.y, e.pointer);
            break;
          case TouchEvent.TOUCH_MOVED:
            processor.mouseMoved(e.x, e.y);
            break;
          case TouchEvent.TOUCH_SCROLLED:
            processor.scrolled(e.scrollAmount);
          }
          usedTouchEvents.free(e);
        }
      } else {
        int len = touchEvents.size();
View Full Code Here

  void processEvents () {
    synchronized (this) {
      justTouched = false;

      if (processor != null) {
        InputProcessor processor = this.processor;

        int len = keyEvents.size();
        for (int i = 0; i < len; i++) {
          KeyEvent e = keyEvents.get(i);
          currentEventTimeStamp = e.timeStamp;
          switch (e.type) {
          case KeyEvent.KEY_DOWN:
            processor.keyDown(e.keyCode);
            break;
          case KeyEvent.KEY_UP:
            processor.keyUp(e.keyCode);
            break;
          case KeyEvent.KEY_TYPED:
            processor.keyTyped(e.keyChar);
          }
          usedKeyEvents.free(e);
        }

        len = touchEvents.size();
        for (int i = 0; i < len; i++) {
          TouchEvent e = touchEvents.get(i);
          currentEventTimeStamp = e.timeStamp;
          switch (e.type) {
          case TouchEvent.TOUCH_DOWN:
            processor.touchDown(e.x, e.y, e.pointer, e.button);
            justTouched = true;
            break;
          case TouchEvent.TOUCH_UP:
            processor.touchUp(e.x, e.y, e.pointer, e.button);
            break;
          case TouchEvent.TOUCH_DRAGGED:
            processor.touchDragged(e.x, e.y, e.pointer);
            break;
          case TouchEvent.TOUCH_MOVED:
            processor.mouseMoved(e.x, e.y);
            break;
          case TouchEvent.TOUCH_SCROLLED:
            processor.scrolled(e.scrollAmount);
            break;
          }
          usedTouchEvents.free(e);
        }
      } else {
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.InputProcessor

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.