Package org.lwjgl.input

Examples of org.lwjgl.input.Controller


      apGAxis = new float[GAMEPAD_MAX][];
      aGAxis = new float[GAMEPAD_MAX][];
      lastGButton = new int[GAMEPAD_MAX];
      lastGAxis = new int[GAMEPAD_MAX];
      lastGAxisPos = new boolean[GAMEPAD_MAX];
      Controller c;
      for (int i = 0; i < GAMEPAD_MAX; i++) {
        c = Controllers.getController(i);
        GAMEPAD_BUTTON_MAX[i] = c.getButtonCount();
        GAMEPAD_AXIS_MAX[i] = c.getAxisCount();
        GAMEPAD_RUMBLER_MAX[i] = c.getRumblerCount();
        aGButton[i] = new byte[GAMEPAD_BUTTON_MAX[i]];
        apGAxis[i] = new float[GAMEPAD_AXIS_MAX[i]];
        aGAxis[i] = new float[GAMEPAD_AXIS_MAX[i]];
        lastGButton[i] = -1;
        lastGAxis[i] = -1;
View Full Code Here


      }
    }
   
    // Controller buttons
    if (controllers) {
      Controller c;
      for (int i = 0; i < GAMEPAD_MAX; i++) {
        c = Controllers.getController(i);
        for (int j = 0; j < GAMEPAD_BUTTON_MAX[i]; j++) {
          if (c.isButtonPressed(j)) {
            if (aGButton[i][j] == RELEASED || aGButton[i][j] == JUST_RELEASED) {
              aGButton[i][j] = JUST_PRESSED;
              lastGButton[i] = j;
            } else if (aGButton[i][j] == JUST_PRESSED) {
              aGButton[i][j] = PRESSED;
            }
          } else {
            if (aGButton[i][j] == PRESSED || aGButton[i][j] == JUST_PRESSED) {
              aGButton[i][j] = JUST_RELEASED;
            } else if (aGButton[i][j] == JUST_RELEASED) {
              aGButton[i][j] = RELEASED;
            }
          }
        }
        for (int j = 0; j < GAMEPAD_AXIS_MAX[i]; j++) {
          apGAxis[i][j] = aGAxis[i][j];
          aGAxis[i][j] = c.getAxisValue(j);
          if (apGAxis[i][j] < 0.75f && aGAxis[i][j] >= 0.75f) {
            lastGAxis[i] = j;
            lastGAxisPos[i] = true;
          } else if (apGAxis[i][j] > -0.75f && aGAxis[i][j] <= -0.75f) {
            lastGAxis[i] = j;
View Full Code Here

    try {
      Controllers.create();
      int count = Controllers.getControllerCount();
     
      for (int i = 0; i < count; i++) {
        Controller controller = Controllers.getController(i);

        if ((controller.getButtonCount() >= 3) && (controller.getButtonCount() < MAX_BUTTONS)) {
          controllers.add(controller);
        }
      }
     
      Log.info("Found "+controllers.size()+" controllers");
View Full Code Here

    try {
      Controllers.create();
      int count = Controllers.getControllerCount();
     
      for (int i = 0; i < count; i++) {
        Controller controller = Controllers.getController(i);

        if ((controller.getButtonCount() >= 3) && (controller.getButtonCount() < MAX_BUTTONS)) {
          controllers.add(controller);
        }
      }
     
      Log.info("Found "+controllers.size()+" controllers");
View Full Code Here

TOP

Related Classes of org.lwjgl.input.Controller

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.