From f91cdb210176ade4be875a7c64df16bf59859f16 Mon Sep 17 00:00:00 2001 From: PeytonPlayz595 <106421860+PeytonPlayz595@users.noreply.github.com> Date: Sun, 7 Jul 2024 20:03:53 -0700 Subject: [PATCH] Reset button states when a controller disconnects --- src/teavm/java/net/PeytonPlayz585/shadow/input/Controller.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/teavm/java/net/PeytonPlayz585/shadow/input/Controller.java b/src/teavm/java/net/PeytonPlayz585/shadow/input/Controller.java index 9dbbe31..5f48f29 100644 --- a/src/teavm/java/net/PeytonPlayz585/shadow/input/Controller.java +++ b/src/teavm/java/net/PeytonPlayz585/shadow/input/Controller.java @@ -256,6 +256,7 @@ public class Controller { int index = arg0.getGamepad().getIndex(); if(connectedControllers.contains(index)) { connectedControllers.remove(index); + resetButtonStates(); System.out.println("Controller disconnected!"); } }