Remap Global Controls To Different Buttons/Keys
-
I want to change some of the global functions so they respond to different keys or buttons. I don’t mean I want to change the layout of my controllers.
For example, normally Hotkey-Player1Start will exit the game and go back to EmulationStation. Without remapping my keys, since I have an Exit button on my console, can I specify Hotkey-Exit would exit the game?
I’m thinking a few changes like this would make it easier for friends to operate everything when I have parties.
-
I think I can be more specific.
Here's my controller:
I'm using it in Keyboard Mode, so the buttons all appear as keys on the keyboard.
In the rectangle in the upper left, I have the following buttons:
Top row: Mouse left, Menu, Pause, Exit, Mouse Right
Bottom row: Start 1, Coin 1, Select, Coin 2, Start 2I'm trying to make functions work a little easier for my friends when they're playing, so I wanted to change some key functions. Currently I use the Select button for the hotkey.
Normal: Exit game: Hotkey-Player1Start
Desired: Exit (without a hotkey)Normal: Pause game: Hotkey-Pause
Desired: Pause (without hotkey)Normal: Reset the Game: Hotkey-Left Shoulder Button (I may be wrong on this)
Desired: Mouse Right (which actually is read as a keypress)Normal: Bring up RGUI: Hotkey-X Button
Desired: Menu buttonI tried changing some of these by using RGUI and found that even though I could change them, they still needed the hotkey. For example, I could change Reset Game to Exit, but it had to be Hotkey-Exit. Can I just not enable a hotkey? If I don't, what are the consequences for not having one? For instance, now, if I have to press Hotkey-Start1 to exit a game, how would I exit a game without a hotkey?
Also, while going through RGUI, I could not find some of these functions, so I don't know if I can call them by using different keys. That includes:
- Exit Game
- Bring up RGUI from within game
Are these functions hardcoded to be specific keys, no matter what? Or is there a way I can change them?
-
I found a solution to this, at least the hotkey part, but it's not universal. It requires editing each emulator's retroarch.cfg file separately. (Of course that means it only works for the emulators that use LibRetro.) This solution is the same as this one.
The ultimate answer is "YES."
As I mentioned, I have some special reasons for wanting to do this, but if you don't enable a hotkey, then there's a problem because the Player1Start button is used for both starting a game and exiting the emulator. Even if you're not a power user, there are other functions that work only with the hotkey feature. So, at first glance, it seems like there's no way to avoid using a hotkey.
I've eliminated the hotkey in Mame-Libretro as well as in EmulationStation, which will help with some groups of friends that will be at my gaming gatherings in the future. (I figure at some point the pandemic will reach a point where we can gather in groups again - at least small groups.)
I'm not using a normal gaming controller. I'm using an Emulator Edition Plus console as part of an arcade cabinet:
Note the extra white A & B buttons on the top left, as well as extra white A2 & B2 buttons, also at the top on the left side of center. Then, to the right, there's a Navigation Menu with 10 keys, Left Mouse Button, Menu, Pause, Exit, and Right Mouse Button along the top. The next row is StartPlayer1, Coin, Select, Coin2, and StartPlayer2.
I also have a door under the console that opens up for a keyboard shelf. It took me a while to realize that I can put power functions on the keyboard so guests don't use them and mess things up.
So here's what I did:
I went into the RGUI and used it to change /opt/retropie/configs/mame-libretro/retroarch.cfg. Under Settings->Input->Hotkey Binds, I changed Exit to the Exit button, Pause to the Pause button, and Reset to the Menu button. (I figured that when you hit Menu to reset the game, you're going to the game's "Menu.") For a bonus, I changed Left Mouse Button to Slow toggle and the Right Mouse Button to Fast forward. I changed Toggle Menu to F1, which is not reachable or useable from the console panel. I also used the A & B buttons on the left to increment and decrement the save state slots and used the A2 & B2 buttons to save and load states.
There's other functions I don't necessarily want people using that I figure I can bind to keys on the keyboard and not to controls on the console.
I tested everything out to make sure I had set up the right bindings in the first place. At this point I had to use Select (my hotkey) to make it work. But then, as a test, I went in and undefined the hotkey. I saved the config (again, to /opt/retropie/configs/mame-libretro/retroarch.cfg), then tested it.
Everything worked fine. So now I can pause by just hitting Pause, without a hotkey. The same with Exit and other functions that previously required a hotkey.
The trick is to redefine all the function bindings and bind them to buttons or keys that are not used without the hotkey first. Once those functions are moved to other keys or buttons, then you can remove the hotkey definition.
-
Tango - thanks for sharing your experimentation with this controller. I have the same one. Question - have you been able to map any or all of the buttons around the 4way joystick? I mean are 2 white buttons to the left of the spinner (A & B) and the two white buttons to the right of the 4way stick (A2 and B2).
if so, could you share how you did this?
-
@celestial: Right now I'm trying to remember what I've done with all this. Without going into detail, a bit of background might help.
Before the pandemic hit, I was saying, "I REALLY need 2-3 weeks without my outside activities, so I can get all this done for the arcade machine, finish the driveway stuff, and move that 140 tons of dirt in the front field down to the barn where I need it." Well, a year later, the driveway is almost done, the dirt is moved and I did take a week to record a lot of tutorials on dealing with this control board, but some of these things have taken months longer than I expected! (That's not mentioning setting up and trying to start a new small business...)
The upshot is I have a lot of videos I have to edit together so I can put them on YouTube and, at this point, I've forgotten how it all works - but I know I explained everything I did in my videos - so once I can sit and edit them through and put them up. I feel like I did some cool things. I remember, somehow, I did manage to use one function for the A & B Buttons and the A2 & B2 buttons. I basically set them up for using them on the menus in EmulationStation. One of the few things I still want to do on the machine itself is to replace the graphics in there to relabel those four buttons and the 4 way joystick up there. (I don't think you can separate the two joysticks - I think they stay paired, but I'm not sure.) Other than the spinner, I'm trying to treat the top section of the board as "management," or buttons to control selecting, pausing, exiting, restarting and doing other things TO the games and the bottom for doing things IN the games.
Sadly, with my notes, it'd take me a long time to decode them these days, which is why I really want to get my tutorials edited and on YouTube.
-
Thanks for responding!
I have a very similar real world work load in front of me which includes tearing down and rebuilding a house, my day job, etc. So I totally understand how it feels to try to get time to monkey with the arcade controls.. Although 140 tons of dirt is a lot of freaking dirt - so however, you managed that - well done!
Would love to see some of the tutorials you took the time to record... when you get to it.
In the meantime - one more question for the moment - I am assuming that you ultimately ended up with the Xtension controller set to KEYBOARD input (i.e. NOT D-INPUT and NOT X-INPUT modes). Because the additional A & B and A2 & B2 buttons do not seem to be active in D-Input mode - even within the Retroarch or MAME menus... i.e. those button do not generate keystrokes of any kind when going thru the binding process....
Is my understanding correct on this point?
Thanks again buddy
-
@celestial Glad to help you!
I've had a number of people here help me out and help me figure out a lot of things on RetroPie. If I don't respond on a thread, feel free to tag me or send me a PM and a link to the page. If I can help, I want to.
I'm almost positive I used Keyboard Input mode. The problem is, and I'm going to post about this when I have time, every time power goes off in the barn for some reason, the file system on my SD card on my Pi messes up. I'm not sure why, but something goes wrong and it won't reboot. I've found if I take the card and plug it into another Linux system, just trying to read the data seems to fix whatever is wrong on the card.
That's where I am now. We got hit with that large ice storm and it knocked out power. (Thankfully we have our 1st floor in the house on the generator!)
So I can't check until I get the card working again. (I really need to transfer the whole RP setup to the USB drive - that survives shutdowns without issue.)
If I remember correctly, they say you can't do what I did in Keyboard Input Mode, but I really wanted to stick with it because, overall, that gave me the fewest problems to deal with.
While I can't remember the mode, one thing that makes me sure it's keyboard is because all the buttons and joystick positions do output characters when I'm in the Linux terminal.
Are you literally rebuilding your entire house? Is this a renovation? I've been involved in a few cases of tearing down most of the inside and redoing it with some historical properties.
140 tons of dirt - well, with my tractor, it can take time, since it's a smaller tractor. The big issue is it has to go from our front field to the barn (where the arcade machine goes) as part of the renovation - it needs some landscaping work. That's about a 1/2 mile round trip for each load! When I was new to dealing with all this and a contractor bailed on me for the driveway (driveway is 1/3 mile long, full roadway is 1/2 mile, including going to the barn), I had to teach myself to use a Bobcat skid steer. After about 3-5 hours of operational time to learn the Bobcat, I got to the lot early one day and moved 200 tons of dirt! (I had to make the driveway go over a 30" culvert).
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.