Skip to content

Conversation

@nijm
Copy link
Contributor

@nijm nijm commented Oct 26, 2025

Description

Map users to core ports on first button press

Core input ports are mapped sequentially when input is received from a physical input device. The first person to press a button becomes player 1, the second becomes player 2, etc.

Configured by the input_assign_ports_on_button_press option. When enabled, all users are unmapped by default (assigned to 'None'/MAX_USERS).

Adds a 'None' option to the 'Mapped Port' setting for each user under Quick Menu->Controls->Port N Controls.

My Use Case

I have 6 wireless controllers:

  • 2x 8BitDo M30 6 button MegaDrive style controllers
  • 2x SNES style controllers
  • 2x PSX style controllers

I prefer to play games with the type of controller they were designed for, but I like having the option to use any of them. Each pair of controllers is identical, so it's hard to know if I've picked up SNES controller 1 or 2 - with this feature I can use either.

With the existing device type reservation feature I ensure each controller type is always mapped to the same 2 users:

  • user 1: 8BitDo MD controller
  • user 2: 8BitDo MD controller
  • user 3: SNES Controller
  • user 4: SNES Controller
  • user 5: PSX Controller
  • user 6: PSX Controller

With core input remapping files I can map the core controls in a sensible way for each controller type. This depends on each controller type always being mapped to the same users. I leave the mapped port setting unset and disable saving the remapping file on exit.

Screenshots

screenshot0_setting screenshot1_mapped_notification screenshot2_user4_mapped_port_0 screenshot3_user0_mapped_port_none

Related Issues

Controller Priority Option (request)
#6707

Related Pull Requests

Hotkeys follow player 1 #18353 - merged

Works well with this merged PR:
Controller device reservation / preference.
#16647

@hizzlekizzle
Copy link
Collaborator

This is a major (optional) change for most platforms, but it's similar to how Android has always worked--though I guess only at a core level rather than the frontend level.

A significant number of users want to use specific original-style controllers, and this seems like a nice way of streamlining that process.

@sonninnos

@nijm nijm marked this pull request as draft October 28, 2025 18:00
@nijm nijm force-pushed the input_remap_on_button_press branch 2 times, most recently from cc04d24 to da110c4 Compare November 1, 2025 10:26
@nijm nijm marked this pull request as ready for review November 1, 2025 10:27
@nijm
Copy link
Contributor Author

nijm commented Nov 1, 2025

Rebased on master as there were some conflicting changes in input_driver_poll. Also made it compatible with the input overlay, which I hadn't considered before.

@nijm nijm mentioned this pull request Nov 2, 2025
@warmenhoven
Copy link
Collaborator

I took a look at the diff, it seems reasonable to me. All my complaints are a little nitpicky. I don't like where the option is in the settings menu, and I don't think it should use the word "remap" because that ends up being a bit of an overloaded term.

@nijm
Copy link
Contributor Author

nijm commented Nov 6, 2025

Thank you for reviewing. Yes, I had some trouble naming this. I'm happy to rename and move it if it means it's more likely to be found and used. Where in the menu do you think would work best and do you have any suggestions for the name?

How about this as an alternative:

Assign Players on Button Press
The first person to press a button becomes player 1, the second player 2, etc.

That might be clearer but the terminology doesn't really fit with the rest of the code.

More suggestions:
Assign Core Ports on Button Press
Assign Ports on Button Press

@hizzlekizzle
Copy link
Collaborator

Maybe change "remap" to "allocate" or "assign"? E.g.:

Assign ports on button press
Core input ports are mapped sequentially when input is received from a physical input device

@nijm nijm force-pushed the input_remap_on_button_press branch from da110c4 to 3fbb0af Compare November 8, 2025 14:59
@nijm
Copy link
Contributor Author

nijm commented Nov 9, 2025

I've rebased, renamed, and moved the setting up the menu in separate commits. The wording is now:

Assign Ports on Button Press
Core input ports are mapped sequentially when input is received from a physical input device. The first person to press a button becomes player 1, the second becomes player 2, etc.

Please let me know if it's OK to be merged like this. If so, I'll need to squash and reword the commit message to refer to the new setting name.

Core input ports are mapped sequentially when input is received from a physical
input device. The first person to press a button becomes player 1, the second
becomes player 2, etc.

Configured by the input_assign_ports_on_button_press option. When enabled, all
users are unmapped by default (assigned to 'None'/MAX_USERS).
@nijm nijm force-pushed the input_remap_on_button_press branch from 9f29249 to 93a3ccc Compare November 18, 2025 20:10
@nijm
Copy link
Contributor Author

nijm commented Nov 18, 2025

Is there any more feedback? Any thoughts on whether this can be merged? I'd love to see this make its way into Retropie, which is where I use it.

Rebased, squashed, and reworded the commit message so it's ready to go.

@hizzlekizzle
Copy link
Collaborator

Yes, i think we're in a bit of a feature freeze while we get the stable build nailed down (after a series of hotfix releases), but we'll get this in ASAP.

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.

3 participants