Two joysticks of the same model can't be used together
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp, json, linux
- Ambito
- desktop-dev, game-dev
Direzione di ricerca
Start by tracing joystickMatchesGuid through joystick-slot assignment and the saved joystick settings, including the legacy Joy0GUID values and the JSON id field. Reproduce with two SDL joysticks sharing a GUID, then inspect device enumeration and available identity data such as SDL_GetJoystickPath or serial numbers. Done means each slot selects a distinct matching device in SDL order, with compatible fallback to the saved GUID; confirm the options UI no longer reports None and both sticks control their assigned roles.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
If you have two joysticks of the same model plugged in, like a pair of identical sticks for a dual-stick setup, the game won't use either of them. At startup neither stick gets a control slot, the Joystick setting in the options shows "None", and the ship doesn't respond to either stick.
SDL gives both sticks the same GUID, since it's built from the bus, vendor, product, version and name, with no serial number. When the saved setting matches more than one connected stick, joystickMatchesGuid refuses to pick one, so nothing gets bound. The old launcher settings (Joy0GUID and friends) hit the same check.
Steps to reproduce
- Plug in two joysticks of the same model.
- Start FSO (master, in-game options on) and pick one of them as the Joystick in the in-game options.
- Quit and start the game again with both sticks still plugged in.
- Start a mission and move either stick.
I reproduced this on Linux with two virtual sticks that share a name, vendor and product, and the setting already saved for one of them (master at 12a36dc1a, retail data, SM1-01). The log shows "No joystick is being used." With only one of them plugged in, the same saved setting works.
Expected vs. actual behavior
Expected: the stick you picked steers the ship, and with a dual-stick setup each slot gets one of the two sticks.
Actual: neither stick is bound, the setting shows "None", and the ship ignores both sticks.
Proposed fixes
Ranked by simplicity, then maintainability, then thoroughness.
- When several connected sticks share the saved GUID, give each slot the first matching stick that isn't already in another slot, in SDL's device order. Small change, no settings format change, and a dual-stick setup works. The catch: the two sticks can swap sides if the OS enumerates them in a different order.
- Save something that tells identical sticks apart alongside the GUID, such as the device path from
SDL_GetJoystickPathor the serial number where the device reports one. The saved JSON already has anidfield that's currently always -1. Use it only to break ties, falling back to the GUID alone, so existing settings keep working. - Move to full per-device identity (name plus GUID plus path or serial) for all saved joystick settings, as discussed in #7481. Most thorough, but it means a settings format change and agreeing on how to migrate old configs.
Related: #813 (SDL GUIDs aren't unique, closed), #7481.
- Lingua principale
- C++
- Stelle
- 488
- Fork
- 184
- Merge medio
- 2g 9h
- PR unite (30g)
- 40
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di scp-fs2open/fs2open.github.com
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
scp-fs2open/fs2open.github.com#7918 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scp-fs2open/fs2open.github.com#7917 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scp-fs2open/fs2open.github.com#7916 ·
I maintainer di solito rispondono entro 1 giorno
-
P2: A timed rotation maneuver does nothing on a ship that had an earlier timed lateral maneuverForse già presa @vovosta l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
scp-fs2open/fs2open.github.com#7914 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scp-fs2open/fs2open.github.com#7901 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di scp-fs2open/fs2open.github.com
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NVIDIA-Omniverse/usd-brep#23 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
qbittorrent/qBittorrent#25121 ·
I maintainer di solito rispondono entro 2 giorni
-
SVT-AV1: Unnecessary size paddingForse già presa @pszemus l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
strukturag/libheif#1945 ·
I maintainer di solito rispondono entro 1 giorno
-
v9.6.0: CMake incorrectly enforces presence of libevdevForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
mltframework/shotcut#1943 ·
I maintainer di solito rispondono entro 1 giorno