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

[Feature Request] Allow to map gamepad buttons to emulator function keys #24

Open
casasfernando opened this issue Sep 22, 2022 · 3 comments

Comments

@casasfernando
Copy link
Contributor

It would be really handy to add the possibility to map gamepad buttons or button combinations to emulator function keys (e.g.: exit emulator).
When running supermodel on dedicated gaming platforms (Steam Deck, RetroPie, etc.) where the main if not the only interface between the user and the system is just a gamepad it can be really useful to be able to access some emulator functions using just that.

Probably the best approach would be to be able to define a "special button" (e.g.: mode button) in the gamepad that when pressed in combination with other buttons (start, select, etc.) can trigger different actions like Exit, Pause, Reset, etc.

Thanks!

@casasfernando
Copy link
Contributor Author

casasfernando commented Oct 30, 2022

@trzy I have a couple of questions related to this FR that could use your comments/feedback:

  1. Are there any reasons why this wasn’t implemented in the past and/or shouldn’t be implemented in the future?
  2. If this would be implemented which would be the preferred approach?
  3. I’m thinking on only a subset of keys that would highly benefit from being accesible with the gamepad: exit, pause, load, save, change slot and screenshot.
  4. Looking at the code since INPUT_UI is not user configurable should this change to configurable? Would be better to create a new one (eg: INPUT_UI_CUSTOM) for the subset of UI keys that would be user configurable? Or add them to the existing INPUT_COMMON?

Thanks

@trzy
Copy link
Owner

trzy commented Oct 30, 2022

It's not unusual for someone to accidentally delete their config file and we wouldn't want a situation where there is no way to use core emulator functions because all keys appear unbound. I think the preferred approach would be that these functions remain permanently bound to the given keys but that optionally, additional bindings can be introduced.

This is a little different than how inputs currently work (they can be cleared). There are probably a couple ways of achieving this. One way would be to create "alt" mappings for all the emulator functions that by default are unbound. Or, we can add a property to inputs that allows a hard-coded binding that cannot be cleared but only added to.

@casasfernando
Copy link
Contributor Author

casasfernando commented Oct 30, 2022

Thanks for sharing the motivation behind the current implementation. It makes sense.

I acknowledge that this feature is not a top priority hence why I wouldn't mind giving it a try and and see if I can implement it myself.
Will take a closer look at the code and see if/what I can do following the guidance above.

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

No branches or pull requests

2 participants