Controller mapping for "admin" buttons (no hotkey, across 2 players)
-
Hi all - first, I know there are a lot of posts about this. I've read through a bunch, and can't figure it out.
I'm running a raspberry pi 4, I have 4 usb encoders that say "SJ@JX" on them. I have a 4 player control panel. The games are playing great! I am using lr-mame2003 for all my games so far, and have successfully mapped buttons across all 4 controllers.
I have 4 buttons on my arcade cabinet that I've set aside for "admin" buttons. I think these are the 4 I want:
- Exit
- Menu (to bring up the mame menu)
- Pause
- Fast Forward
I'm having a few challenges:
Challenge 1: Exit without "Hot Key"
Right now, select+start (mapped to my coin, 1up buttons), works great for exiting the emulator. I'd like to map that to just the Exit button, no hot key.First, I set the input_exit_emulator_btn to "10", so it is its own button instead of sharing it with the start button. That worked.
But I can't figure out how to disable the hot key. Setting input_enable_hotkey_btn to "nul", but that just broke everything and I couldn't exit anymore.
Any other advice? I've seen one post say that this isn't possible with the type of USB encoder I have, only with keyboard USB encoders?
Challenge 2: Menu button
Similarly, I'd like to map a button to "Menu" to bring up the Mame Menu. So I figure I have to do this from the general input menu in Mame. But for some reason, when I try to map it to my Menu button, nothing happens. It works fine if I map it to something like A, L2, R2, etc. But when I press the Menu button, nothing happens (it does show up as working in jstest though!).
Challenge 3: 2 more buttons
I'm not sure how to configure pause and fast forward. My USB encoder doesn't seem to have any more button hookups (it has a few more hookups named "Mode" "Turbo" "Clear" and "Auto", but those don't trigger anything in jstest - so I'm not sure if I can use them?). So I think what I want to do is use buttons 9/10 from Player 2 instead of Player 1, and then I can just use Mame general input to configure these. So, assuming that works, I think this is the same as Challenge 2.Thanks for all your help.
-
@jigidyjim Hey! I am not an expert at this, but I have been working with RetroPie for a few months now and though some learning on my own and lots of advice from folks here, I have picked up a few things.
- I am not sure if this would work, but it is worth a shot. You could edit the .cfg files for your controllers and assign the "special" and "start" to the buttons you want to use for the Exit button and the Menu button.
Your question about Pause and Fast Forward led me to do a little research, and here is something I found on Reddit- the posts were old, and these commands may or may not work. I haven't tried the,
Pause is also mapped to the P key in lr- emulators; you can map it in a .cfg file like so:
input_pause_toggle = "9"
where "9" is the pause button.input_toggle_fast_forward_btn = "1"
where 1 is the ff button.I suspect you could assign these keys to the special key and the pause/ff key too.
You may need to use more than one controller to do this; I don't think you can have the special key assigned to more than one button per controller config. If all of your controllers use the same config, there could be some problems.
-
lr-Mame2003 has a built-in button to connect to the MAME menu; in the RetroArch controls menu, is assigned to Auto 4 on the first controller profile and R2 on the second. I think it is also mapped to the ESC key on a keyboard. You could assign the button you wish to connect to the Mame menu button in RetroArch.
-
Additional buttons. Many controllers have buttons that do not map to RetroPie but change functions on the controller; some 8BitDo controllers have a button that turns on and off a turbo function on the controller. I am pretty sure these buttons cannot be used to interface with lr-mame2003 or RetroPie in general because like you, I don't see them respond when I test them in jstest.
Good luck! This sounds like a pretty cool set up. I hope it all works out.
David
-
Thanks so much for the response! Some follow ups:
@daviddraper said in Controller mapping for "admin" buttons (no hotkey, across 2 players):
@jigidyjim Hey! I am not an expert at this, but I have been working with RetroPie for a few months now and though some learning on my own and lots of advice from folks here, I have picked up a few things.
- I am not sure if this would work, but it is worth a shot. You could edit the .cfg files for your controllers and assign the "special" and "start" to the buttons you want to use for the Exit button and the Menu button.
I don't think that would work - how would I set up the coin/1up buttons then?
Your question about Pause and Fast Forward led me to do a little research, and here is something I found on Reddit- the posts were old, and these commands may or may not work. I haven't tried the,
Pause is also mapped to the P key in lr- emulators; you can map it in a .cfg file like so:
input_pause_toggle = "9"
where "9" is the pause button.input_toggle_fast_forward_btn = "1"
where 1 is the ff button.Is there documentation for what all the available input types are? The only file I've been able to find is the autoconfig one for my controller, which is '/opt/retropie/configs/all/retroarch/autoconfig/DragonRise Inc. Generic USB Joystick .cfg' which doesn't have those in them.
I suspect you could assign these keys to the special key and the pause/ff key too.
You may need to use more than one controller to do this; I don't think you can have the special key assigned to more than one button per controller config. If all of your controllers use the same config, there could be some problems.
I think this is my main problem. From my 4 admin buttons, I need 2 to come from usb encoder #1, and 2 to come from usb encoder #2. Any idea if that's possible?
- lr-Mame2003 has a built-in button to connect to the MAME menu; in the RetroArch controls menu, is assigned to Auto 4 on the first controller profile and R2 on the second. I think it is also mapped to the ESC key on a keyboard. You could assign the button you wish to connect to the Mame menu button in RetroArch.
I was actually trying to configure this from the MAME menu itself, but that doesn't work for buttons 10 and 11 for some reason. I can set it to any other button and it works fine. I'm not sure why 10 and 11 are behaving differently?
- Additional buttons. Many controllers have buttons that do not map to RetroPie but change functions on the controller; some 8BitDo controllers have a button that turns on and off a turbo function on the controller. I am pretty sure these buttons cannot be used to interface with lr-mame2003 or RetroPie in general because like you, I don't see them respond when I test them in jstest.
Good luck! This sounds like a pretty cool set up. I hope it all works out.
David
-
BTW - specifying the pause and fast forward buttons in the cfg file worked great! (it's input_pause_toggle_btn with the "btn" on the end though).
But:
- It still required the hotkey to be pressed - so same issue I have with the exit button
- I still have the problem of how I'm going to get all 4 buttons working, if they have to be spread across USB encoders...
-
- I am not sure if this would work, but it is worth a shot. You could edit the .cfg files for your controllers and assign the "special" and "start" to the buttons you want to use for the Exit button and the Menu button.
I don't think that would work - how would I set up the coin/1up buttons then?
Good question- the "special" button works kind of like the shift key on the keyboard.
For "Start" and "Select" keys to function, you don't need to be holding down the special key. And while the special key is mapped to whatever the Select key is mapped to by default, they don't need to be this way. For example:input_enable_hotkey_btn = "2"
--- this line in the .cfg file tells us what button is the special button
`input_select_btn = "2" --- this line in the .cfg tells us what button is the select button.input_start_btn = "11"
-- hi start button
input_exit_emulator_btn = "11"
heeeeello exit button (must be pressed at the seme time as the hotkey button to work)You can assign the hokey and exit_emulator to whatever button you choose.
Whatever button is mapped select will still work for coins, and whatever button is mapped to start with still be P1 start.Your question about Pause and Fast Forward led me to do a little research, and here is something I found on Reddit- the posts were old, and these commands may or may not work. I haven't tried the,
Pause is also mapped to the P key in lr- emulators; you can map it in a .cfg file like so:
input_pause_toggle = "9"
where "9" is the pause button.input_toggle_fast_forward_btn = "1"
where 1 is the ff button.Is there documentation for what all the available input types are? The only file I've been able to find is the autoconfig one for my controller, which is '/opt/retropie/configs/all/retroarch/autoconfig/DragonRise Inc. Generic USB Joystick .cfg' which doesn't have those in them.
I suspect something like this is out there, perhaps in the RetroPie docs (https://retropie.org.uk/docs/). I have not seen it myself.
I suspect you could assign these keys to the special key and the pause/ff key too.
You may need to use more than one controller to do this; I don't think you can have the special key assigned to more than one button per controller config. If all of your controllers use the same config, there could be some problems.
I think this is my main problem. From my 4 admin buttons, I need 2 to come from usb encoder #1, and 2 to come from usb encoder #2. Any idea if that's possible?
Smarter minds than mine will need to help you what that problem. In my experience, trying to figure out what MAME cores work for what ROMS is peanuts in my experience, compared to finding controllers that have different .cfg file names.
- lr-Mame2003 has a built-in button to connect to the MAME menu; in the RetroArch controls menu, is assigned to Auto 4 on the first controller profile and R2 on the second. I think it is also mapped to the ESC key on a keyboard. You could assign the button you wish to connect to the Mame menu button in RetroArch.
I was actually trying to configure this from the MAME menu itself, but that doesn't work for buttons 10 and 11 for some reason. I can set it to any other button and it works fine. I'm not sure why 10 and 11 are behaving differently?
I don't know about that one, sorry. :-(
-
I worked on this a bit more. I realized that since I’m 100% playing mame 2003 right now I really don’t need 8 buttons for player 1... so I decided to disconnect L2/R2 and use them for the admin buttons. Maybe someday I’ll want an 8 button game but I guess that’s a future problem :)
So now I have:
- one button bringing up the mame menu, no hot key needed. This is now working great (L2 works fine for this, L3 did not).
- 3 buttons doing pause, fast forward, and exit - all still need the hotkey.
There are so many similar posts about “how do I make this button work without a hotkey”, but still haven’t found a solution that works yet.
-
@jigidyjim said in Controller mapping for "admin" buttons (no hotkey, across 2 players):
There are so many similar posts about “how do I make this button work without a hotkey”, but still haven’t found a solution that works yet.
Because there isn't - once you set-up a hotkey in RetroArch, all the hotkey enabled actions (exit/pause/ff/etc.) are only accessible with hotkey combinations.
If you're willing to experiment, there is a more involved method by using RetroArch's network control interface. You'll need to configure triggerhappy ( installed by default on Raspberry OS Lite, so available in RetroPie) to react to the 'extra'/'admin' buttons' input and send the commands to RetroArch via the network port - make sure you enable the command port withnetwork_cmd_enable = true
in yourretroarch.cfg
. -
@mitu thanks - that looks like a nice little challenge for me to hook up. I'll put that down as my next project, it will help me learn a few more things.
One of the things that confused me was that I thought I could disable hotkeys entirely, and just specify direct buttons (and the ones I didn't specify just couldn't be used). When I searched older posts, it says to go to the retroarch gui and choose input -> input hotkey binds and then disable "enable hotkeys". But I think maybe that option no longer exists? At least in the version of retroarch I have (I think it's 1.8.8?) I see "hotkey binds" not "input hotkey binds" as the name of the menu, and I don't see any option to "enable hotkeys" at all.
If there is a way to disable all hotkeys, and then just specify the individual butons I want, I would be fine with that for now. Mostly I just want an easy access pause and quit button for the less savy people using the arcade cabinet.
-
You have the option to not set a hotkey during the input configuration in EmulatioStation - did you try to use it ?
The configuration for 'Hotkeys' still exists in the RGUI, under Settings -> Input -> Hotkey Binds, When you open the RGUI, you're under 'Quick menu', you need to back out (with the B buttons or the key you mapped to it) and you'll be in the main menu screen.
However, that won't have any effect if input_enable_hotkey_btn is set from the gamepad's auto-configuration file - which is how RetroArch is configured in RetroPie. You can do the modification in the gamepad's configuration file, but you said at the beginning that doing it broke your config ? -
Here's my history with the command button search... maybe it will help as you think your way through this.
I'm in the process of building a cab that uses 4 joystick usb controllers, not a keyboard encoder. Based on my research and documentation, you "should" be able to have no hot key/button set, and then program other buttons to do commands without the need for holding down the hotkey. I could not get this to work using an attached keyboard. My thought was that if I could get this to work with an attached keyboard, I could buy a mini keyboard controller just for the hotkeys.. Either way it didn't work even though this is what the documentation seems to say. The next thing to keep in mind is hotkeys on a joystick controller only seem to work on the player 1 joystick controller, not the others. (someone correct me if I'm wrong here)
I found some software I could run that would virtually merge an additional joystick controller, thereby adding a whole bunch of extra buttons. I considered buying an additional joystick controller to virtually merge with Player 1 thereby creating a bunch more additional buttons. Then I could simply set a button as a hot key, jumper it, and then use the extra buttons for my actual commands. Here I would have to make sure that I clear out some of the default hot key settings as the hotkey basically becomes pressed since it's jumpered.
Eventually I decided on a hardwired solution. I have 4 unused button slots on joystick controller 1. I'm setting 1 button as a hot key, the other 3 as commands, and hard wiring the whole thing using diodes to trigger the hotkey+button for each 1 command button. I push 1 button, it pushes 2 buttons on the controller thereby auto-trigger the hot key. I also hard wired commands to the select and start, giving me a total of 5 instant command buttons + the hotkey in case I want to set hotkeys on the player 1 joystick and buttons.
Here is what my command buttons look like...
-
@mitu thanks. Today I tried 3 different things, all had the same effect which was pressing my button had no effect:
Set enable_hotkey_input_btn to “nul” in my controllers auto config file
Removed enable_hotkey_input_btn from my controllers auto config file
Used the RetroPie configure input UI, did not set a hotkey, and then manually added the exit button back to the controllers auto config fileSo it seems like I cannot use the exit button (or other buttons) unless it is with a hotkey, or at least I haven’t figured out how yet!
-
That is what I found when dealing my joystick controllers... so I opted for a wired solution... here's a link to what that looks like. ...I made sure tested my wiring setup first before I mounted all the buttons
-
@jigidyjim Can you post your controller's configuration file ?
-
@MadDogHoek818 - thanks for sharing that wiring info! Super cool. I'll dig into that a bit more.
@mitu Here's my config file - currently the hotkey is mapped to my select button and the exit/pause/fastforward work fine if i use the hotkey. If I remove it, or set it to "nul", those other buttons don't do anything.
/opt/retropie/configs/all/retroarch/autoconfig $ more DragonRise\ Inc.\ \ \ Generic\ \ \ USB\ \ Joystick\ \ .cfg input_device = "DragonRise Inc. Generic USB Joystick " input_driver = "udev" input_enable_hotkey_btn = "8" input_l_btn = "6" input_load_state_btn = "6" input_up_axis = "-1" input_left_axis = "-0" input_state_slot_decrease_axis = "-0" input_select_btn = "8" input_r2_btn = "3" input_right_axis = "+0" input_state_slot_increase_axis = "+0" input_l2_btn = "7" input_r_btn = "2" input_save_state_btn = "2" input_y_btn = "4" input_x_btn = "5" input_menu_toggle_btn = "3" input_down_axis = "+1" input_start_btn = "9" input_exit_emulator_btn = "11" input_b_btn = "0" input_reset_btn = "0" input_a_btn = "1" input_pause_toggle_btn = "7" input_toggle_fast_forward_btn = "10"
-
Well, this looks a little disheartening. I can't believe you would have to hardwire a shift/alt button, but I'm glad I found this thread before I went down the rabbit hole. I'm currently using a controller called the iPac and it has a mode that acts like a keyboard as well as a mode where it acts as a USB controller. There is a keymap/button configuration tool and also provides a macro setting. I'm hoping this will be the solution because I don't like the idea of getting into a situation in the future where I have hard-wired macros and the software changes the way it works. Regardless, thanks for the thread which really shortened my research time.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.