Package net.java.games.input

Examples of net.java.games.input.Controller.poll()


        }

        @SuppressWarnings("unused") float dx = 0;

        while (running) {
            joystick.poll();
            for (Component c : joystick.getComponents()) {

                if (c.getName().equals("x")) {
                    dx += c.getPollData();
                } else if (c.getName().equals("pov")) {
View Full Code Here


            boolean flyUp = Keyboard.isKeyDown(Keyboard.KEY_SPACE);
            boolean flyDown = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT);
            boolean moveFaster = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL);
            boolean moveSlower = Keyboard.isKeyDown(Keyboard.KEY_TAB);

            joystick.poll();
            for (Component c : joystick.getComponents()) {
                double dy = 0, dx = 0;
                if (c.getName().equals("x")) {
                    joystickSpeed = (int) ((-c.getPollData() + 1.1) * 10);
                    if (c.getPollData() < -.004) {
View Full Code Here

      isPolling = true;
      while (isPolling) {

        /* Poll the controller */
        controller.poll();

        // StringBuffer buffer = new StringBuffer();

        // TODO - selectively publish ... publish Direction? Yes
        /* For each component, get it's name, and it's current value */
 
View Full Code Here

            // Currently selected controller.
            int selectedControllerIndex = window.getSelectedControllerName();
            Controller controller = foundControllers.get(selectedControllerIndex);

            // Pull controller for current data, and break while loop if controller is disconnected.
            if( !controller.poll() ){
                window.showControllerDisconnected();
                break;
            }
           
             // X axis and Y axis
View Full Code Here

      Controller controller = foundControllers
          .get(selectedControllerIndex);

      // Pull controller for current data, and break while loop if
      // controller is disconnected.
      if (!controller.poll()) {
        window.showControllerDisconnected();
        break;
      }

      // X axis and Y axis
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.