-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to "reserve" devices by player in Android using settings #16269
Add ability to "reserve" devices by player in Android using settings #16269
Conversation
7976bac
to
e148c31
Compare
let's see if @sonninnos and/or @LibretroAdmin care to take a look |
In this commit (7658c80), I made it so that the settings themselves, and the method to get a reserved port based on the settings, was no longer Android specific. However, the only place that it's being used is in the Android input driver: RetroArch/input/drivers/android_input.c Lines 1401 to 1407 in 7658c80
So it only works on Android, but it makes it so that other platforms and input drivers can use it, too |
928b1e3
to
57bedd3
Compare
dc16a01
to
d6adef8
Compare
c69a36c
to
2e64d80
Compare
85fe09d
to
8cb3f68
Compare
This reverts commit 8cb3f68.
8cb3f68
to
9f63f01
Compare
@LibretroAdmin This is good for another review now 👍 |
Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Moved it to autoconfig to be more generic. Testing and GUI updates are needed, refinements also possible.
Hi @PatrickStankard, this is one of the requests that are recurring, thank you for taking the effort! I lifted your code and moved it to autoconfig part, and it works there as well: The advantage of having it in the autoconfig part would be that it is then automatically valid for all joypad drivers, Matching the driver defined ports to the player* settings is done by I extended the test joypad driver and ran a few tests, looks OK so far but there may still be some corner cases, removing devices, multiple devices with same vid/pid, etc... so at least this modified version still needs work. If you agree, we could collaborate on this in some form. |
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Test joypad driver was extended for more tests.
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Test joypad driver was extended for more tests.
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Test joypad driver was extended for more tests.
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Test joypad driver was extended for more tests.
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Test joypad driver was extended for more tests.
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Test joypad driver was extended for more tests. --------- Co-authored-by: Patrick Stankard <[email protected]>
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Test joypad driver was extended for more tests. Co-authored-by: Patrick Stankard <[email protected]>
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Test joypad driver was extended for more tests. Co-authored-by: Patrick Stankard <[email protected]>
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard #16269 Test joypad driver was extended for more tests. Co-authored-by: Patrick Stankard <[email protected]>
This was merged as a part of #16647 |
For each player, 2 new options are added: - a reservation type (no reservation, preferred, reserved) - a reserved device name When handling port - player assignments, reserved devices will be assigned to the respective player port. If reservation type is "reserved", no other device can take that port automatically. Reservation config option and matching function lifted from: PatrickStankard libretro#16269 Test joypad driver was extended for more tests. Co-authored-by: Patrick Stankard <[email protected]>
Description
I use RetroArch on an Arcade1Up Simpsons arcade cabinet running Android 10. I wanted to be able to have a controller always map to a specific player when it's plugged in, regardless of the order that it was initialized by RetroArch.
This PR adds settings to the configuration, so that you can "reserve" a device for a given player, based on it's VID/PID, or name. I based this on how the
input_android_physical_keyboard
setting is handled. This is very useful in my specific situation (running a MAME 2003-plus core where the player order needs to match the order of the controllers mounted in the cabinet), but I could image it being useful in other situations, too.Right now, only the Android input driver is checking to see if a port is reserved, based on the config value. However, other input drivers utilize this change by calling
input_device_get_reserved_port
.Related Issues
#12924
Reviewers
I'm not sure who to tag for a review, but I'll post the PR in Discord