Skip to content

Add per-player joystick configuration system#3816

Open
catzh23 wants to merge 1 commit into
SuperTux:masterfrom
catzh23:feature/per-player-joystick-config
Open

Add per-player joystick configuration system#3816
catzh23 wants to merge 1 commit into
SuperTux:masterfrom
catzh23:feature/per-player-joystick-config

Conversation

@catzh23

@catzh23 catzh23 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Replace single global joystick config with per-player independent configurations.

Each player now has their own JoystickConfig instance stored in a map<int, JoystickConfig> keyed by player ID. Bindings are stored as (player, button) pairs, consistent with KeyboardConfig's PlayerControl approach. The JoystickMenu mirrors KeyboardMenu, showing Player 2, 3 entries for additional players. Configurations are serialised to the existing config.cfg under a new joystick-configs section, with migration support for the old single-config format.

The JoystickMenu changes also update refresh_menu_item to refresh_control, mirroring the pattern used in KeyboardMenu, which we considered pertinent as part of modernising the menu.

Closes #3572

Replace single global joystick config with per-player independent
configurations.

Each player now has their own JoystickConfig instance stored in a
map<int, JoystickConfig> keyed by player ID. Bindings are stored as
(player, button) pairs, consistent with KeyboardConfig's PlayerControl
approach. The JoystickMenu mirrors KeyboardMenu, showing Player 2, 3
entries for additional players. Configurations are serialised to the
existing config.cfg under a new joystick-configs section, with
migration support for the old single-config format.

Closes SuperTux#3572

Co-authored-by: Joana Saraiva <joana.t.saraiva@tecnico.ulisboa.pt>
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.

[Feature Request]: Separate configuration for each game controller

2 participants