HarbourMasters / HarbourMasters/Shipwright

Menu Controller Navigation stops working when controller disconnects

Open
#5,437 2 comments 1 reaction 1 assignee Claimed by @briaguya0 View on GitHub
Dominant language
C
Stars
5.4k
Forks
837
Avg merge
1d 9h
Merged PRs (30d)
72

Description

Steps of the issue:

1. I was using Menu Controller Navigation just fine.
2. I was idle for some time and my controller turned off by itself to preserve battery.
3. When I reconnected it, Menu Controller Navigation stopped working. Forever. No matter how much I open and close the application, or connect and reconnect the controller, I cannot get it working again.

In-game controls seem to work ok. Just menu navigation seems to have been affected.
And, yes, I have checked multiple times if turning on and off the option for controller navigation makes any difference. It does not.

I do apologize for not finding a way to properly reproduce this, as I cannot find a way to reset before it was broken.

For reference:
- Platform: Manjaro Linux, Gnome/X11
- Controller: 8bitdo Pro 2 (it is recognized as an Xbox One Controller by the application)

---

**Update:**

After some investigating, I suspect the issue (in my case) might be caused by SDL wrongly recognizing non-controller devices as controllers. Like so:

![Image](https://github.com/user-attachments/assets/66e158a1-6a2b-496b-9e4e-c47c993cca78)

Disconnecting the other device and restarting SoH makes controller menu navigation work again.

[Now the issue with SDL2 seems to also happen with other input backends and could be a problem with Linux input overall](https://github.com/ocornut/imgui/issues/3240). But, for this project, the issue then becomes this:

**Only the first controller to be recognized _on startup_ gets to be used for menu navigation. Anything else is ignored, no matter how much you disconnect and reconnect controllers.** This I have tested to be true, and I suspect is the core of this issue.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.