Skip to content

Commit

Permalink
XInputDriver: check return value of poll() instead of isConnected() t…
Browse files Browse the repository at this point in the history
…o determine connection state - the state is only updated as a result of calling poll()
  • Loading branch information
bwRavencl committed Oct 29, 2023
1 parent a615d4d commit 969c7d1
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,10 @@ public void deInit(final boolean disconnected) {

@Override
public boolean getGamepadState(final GLFWGamepadState state) {
if (xinputDevice == null || !xinputDevice.isConnected()) {
if (xinputDevice == null || !xinputDevice.poll()) {
return false;
}

xinputDevice.poll();

final var components = xinputDevice.getComponents();

final var axes = components.getAxes();
Expand Down

0 comments on commit 969c7d1

Please sign in to comment.