Skip to content
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

mupen64plus: update runtime hotkey configuration #3706

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cmitu
Copy link
Contributor

@cmitu cmitu commented Apr 17, 2023

The Mupen64plus start-up script adds 3 'hotkey' combinations for the connected joysticks by looking at the RetroArch auto-config profile(s) for the joysticks.

To handle cases when the SDL joystick name (used by Mupen64Plus) is different than the 'udev' name and the auto-config profile is not found just by looking at the filename, an additional search for the profile .cfg files was added - using the 'vendor' and 'product' IDs of the joystick. This takes advantage of the changes in e392c7a for the input configuration, which save 'vendor'/'product' IDs to the RetroArch's auto-config profile.

I re-organized a bit the hotkey bindings loop so it's indexed by the number of joysticks detected. This avoids searching for the auto-config profile 3 times (# of hotkey bindings), which can is more expensive when using grep to look up the vendor/product IDs. Since 'bind' is a reserved built-in in Bash, I renamed it to hotkeys_bind, similar to the other arrays used for hotkeys set-up.

The Mupen64plus start-up script adds 3 'hotkey' combinations for the connected joysticks by looking at the RetroArch auto-config profile(s) for the joysticks.

To handle cases when the SDL joystick name (used by Mupen64Plus) is different than the 'udev' name and the auto-config profile is not found just by looking at the filename, an additional search for the profile .cfg files was added - using the 'vendor' and 'product' IDs of the joystick. This takes advantage of the changes in e392c7a for the input configuration, which save 'vendor'/'product' IDs to the RetroArch's auto-config profile.

I re-organized a bit the hotkey bindings loop so it's indexed by the number of joysticks detected. This avoids searching for the auto-config profile 3 times (# of hotkey bindings), which can is more expensive when using `grep` to look up the `vendor`/`product` IDs. Since 'bind' is a reserved built-in in Bash, I renamed it to `hotkeys_bind`, similar to the other arrays used for hotkeys set-up.
@cmitu
Copy link
Contributor Author

cmitu commented Apr 17, 2023

I've set it to draft since it may have merge issues after #3696 is merged, but the implementation (pending review changes) should be ok.

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.

None yet

1 participant