Skip to content

Fix joystick not being detected after reconnecting - #5094

Open
TheCrazy17 wants to merge 2 commits into
multitheftauto:masterfrom
TheCrazy17:fix/joystick-reconnect
Open

Fix joystick not being detected after reconnecting#5094
TheCrazy17 wants to merge 2 commits into
multitheftauto:masterfrom
TheCrazy17:fix/joystick-reconnect

Conversation

@TheCrazy17

Copy link
Copy Markdown
Contributor

Summary

Makes MTA keep looking for a joystick after startup instead of only checking once. Covers connecting a controller after MTA is already open, reconnecting one that was unplugged, and Xbox style pads that only show up through XInput. Also listens for Windows' own device notifications so a connect or disconnect gets picked up right away instead of waiting for the next retry.

Motivation

MTA only ever checked for a joystick once, right at startup. If nothing was plugged in yet, or if you unplugged and replugged a controller mid session, it never looked again until you restarted the game.

Fixes #5088.

Test plan

Open MTA with no controller connected, then plug one in and confirm it gets picked up without restarting. Unplug it and plug it back in, confirm it keeps working.

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

… check, and drop one that stops responding so a replug gets noticed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MTA is not registering controller device after it disconnects

1 participant