Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Two joysticks of the same model can't be used together

Abierto
#7,889 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp, json, linux

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

  1. Plug in two joysticks of the same model.
  2. Start FSO (master, in-game options on) and pick one of them as the Joystick in the in-game options.
  3. Quit and start the game again with both sticks still plugged in.
  4. 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.

  1. 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.
  2. Save something that tells identical sticks apart alongside the GUID, such as the device path from SDL_GetJoystickPath or the serial number where the device reports one. The saved JSON already has an id field that's currently always -1. Use it only to break ties, falling back to the GUID alone, so existing settings keep working.
  3. 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.

Lenguaje dominante
C++
Estrellas
488
Forks
184
Merge medio
2 d 9 h
PR fusionados (30 d)
40

Preparar el entorno

Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de scp-fs2open/fs2open.github.com

Todos los issues de scp-fs2open/fs2open.github.com

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.