Utilize new ControllerListener events to keep track of controller plugs and unplugs. Switch to true controller hotswapping detection

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 2 years ago committed by GitHub
parent 11bf992721
commit 7910762683
  1. 11
      src/sig/RabiClone.java

@ -81,7 +81,12 @@ public class RabiClone implements ControllerListener{
public static RenderingHints RENDERHINTS = new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);
public static void main(String[] args) {System.setProperty("sun.java2d.transaccel", "True");
public static void main(String[] args) {
RabiClone r = new RabiClone();
ControllerEnvironment.getDefaultEnvironment().addControllerListener(r);
System.setProperty("sun.java2d.transaccel", "True");
System.setProperty("sun.java2d.d3d", "True");
System.setProperty("sun.java2d.ddforcevram", "True");
System.setProperty("sun.java2d.xrender", "True");
@ -300,5 +305,9 @@ public class RabiClone implements ControllerListener{
@Override
public void controllerAdded(ControllerEvent ev) {
System.out.println("Added: "+ev.getController());
AbstractController[] newArr = Arrays.copyOf(CONTROLLERS,CONTROLLERS.length+1);
newArr[CONTROLLERS.length] = ev.getController();
CONTROLLERS=newArr;
ConfigureControls.LoadControls();
}
}

Loading…
Cancel
Save