Remove controller from list when polling errors occur.

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 3 years ago
parent 7f6aa67e1e
commit c24c6a3972
  1. BIN
      RabiClone_0.0a.zip
  2. BIN
      bin/RabiClone.jar
  3. 9
      src/sig/RabiClone.java

Binary file not shown.

Binary file not shown.

@ -102,6 +102,14 @@ public class RabiClone{
//System.out.println(c.getName()+","+c.getIdentifier()+": "+c.getPollData());
}
//System.out.println("--------");
} else {
Controller[] newArr = new Controller[CONTROLLERS.length-1];
for (int j=0;j<CONTROLLERS.length;j++) {
if (j!=i) {
newArr[(j>i?j-1:j)]=CONTROLLERS[i];
}
}
CONTROLLERS=newArr;
}
/*EventQueue queue = controller_list[i].getEventQueue();
@ -134,6 +142,7 @@ public class RabiClone{
}
if (Key.isKeyHeld(KeyEvent.VK_F5)&&System.currentTimeMillis()-lastControllerScan>5000) {
CONTROLLERS=ControllerEnvironment.getDefaultEnvironment().rescanControllers();
System.out.println(Arrays.toString(CONTROLLERS));
lastControllerScan=System.currentTimeMillis();
}

Loading…
Cancel
Save