How to make two different buttons do the same function (fire)


I’m building an arcade setup using a normal arcade joystick and buttons (kit w/buttons&usb controller) - not a gamepad. I’m playing games like Joust, Zaxxon, Dig Dug and am using lr-mame2003 with RetroPie. Many of the old arcade games have the joystick in the middle, with a fire button on BOTH sides of the joystick. Pressing either fire button fires, so both of the buttons do the same ‘function’.

I’d like to set up my controller this way:

Fire1 Fire2 joystick Fire1 Fire2

I’m having problems figuring out where to make edits, and what the edits should be to make both of the Fire1 buttons correspond to the same function. Thinking along the lines of the ABXY concept for Fire1 and Fire2 (2 buttons each), I’d be looking at:

button2 = B

button3 = Y

button4 = B

button5 = Y

button6 = X etc

The problem (I think) is that retroarch has the params flipped function=button (input_player1_b_btn = 2), not button=function (button 2 = input_player1_b_btn), so I can’t say player1_b_btn = button 2 AND 4

Any ideas for how to make a “fire1 fire2 joystick fire1 fire2” button arrangement?

p.s. at some point I’ll add in a trackball too, so the setup would be - but I think adding a trackball won’t mess things up:

Fire1 Fire2 joystick Fire1 Fire2 trackball


You’ll have to do it through the quick menu > controls remapping menu. There, you can cycle through each of the core’s functions on any given button, so if you want “jump” (say, “core function 2”), you can cycle to that same function on more than one physical button.

However, I don’t think you can mix and match P1 and P2 buttons, as they are discrete devices.


Maybe I’m missing something, but when I go into the control remapping menu, the left side is only the function (fire), and the right side is the adjustable button parameter. That means that there is only one option for fire listed in the left column.

What I need, in essence is for those two columns to be switched, where the unchangeable column is the button number, and the changeable one is the function (fire/a/x/etc).

Because currently I can’t say that button 2 and 4 are BOTH “player1_b_btn”

I have 1.7.5 of retroarch installed, with mame2003/0.78.


On the left side, you should have your physical gamepad (or the retropad, if your gamepad isn’t autoconfigured or the autoconfig profile doesn’t have button labels). On the right side, you should have your core’s buttons:

As you can see here, I’ve made two of my physical buttons both do the function of playstation-square. That’s what you’ll need to do. Physical button 1 and physical button 3 will both need to be set to core button fire1, while physical button 2 and physical button 4 both need to be core button fire2. (If I’m understanding you correctly)


I think that your platform for retroarch works differently than on retropie - or I’m in the wrong part of retroarch (I’m new).

It appears that what you are showing is what I’m looking for. In yours I think the left side are your controller’s buttons and the right side (the variable) are the functions it does. In mine, the left side are the functions and the right side are the controller’s buttons (variable). So - I’m unable to say make “L2 button (trigger)” be button 8 and “L2 button (trigger)” be button 9.

I’m really looking for a way for the physical buttons to be constant, and the function be a repeatable variable.

For example - I just want the ability to have controls like Dig Dug - a fire button on both sides so users can use either their left or their right hand to push the button: image


this is the opposite of what you were describing as the goal. You don’t need L2 to be 2 different functions, as that would make both of those functions trigger whenever you pressed L2 (i.e., a macro, or “one to many”), which isn’t possible in RetroArch. What you were describing is having multiple buttons with the same function (i.e., “many to one”).

So, looking at your screenshot, it appears your input device shows up as a keyboard, correct? So, you have the one selected that triggers “key: x” and its current function is Button 4. If you press left/right while it’s selected, Button 4 should cycle through the other buttons that the core exposes. If “fire 2” is Button 3, you already have “key: s” as Button 3, so cycle “key: x” to Button 3, as well, and you’re set.


My original ask was to be able to have this setup - and I am trying to get there with mame2003/retropie. (physical) button2 = (function) B (physical) button4 = (function) B

In the cfg files it would be akin to: input_b_btn = “2” input_b_btn = “4” (i’ve tried this, but it doesn’t work - forgot if it end up using the 2 or the 4)

What you describe is below, which won’t satisfy the Dig Dug example. (physical) button2 = (function) B (physical) button2 = (function) X

My controller isn’t a keyboard, but rather a USB joystick.


Did you try the steps I described?

Ignore the part about keys, it’s just to identify the physical button (i.e., the ones on the left). The core’s buttons are on the right.

correct, you can’t do it through the config file or settings > input > p1 input binds, only in quick menu > controls.


It would be nice if we could mix and match P1 and P2 buttons, only for Perfect Dark and Goldeneye (you can use P1 stick for movement and P2 stick for direction, in a true dual analog setup). This is possible with standalone emulators.


Apologies - took a while to get back to this. So - I followed your directions and it worked - thanks!

I was able to get two buttons matched up (different physical, same function) - but basically through trial and error, and I’m not sure I could recreate it from scratch. I’m pretty confused about how to know what the function maps to in the game.

Using jstest, I know what button number each physical button appears as to the system. But - when retroarch has this line, how do I know what the “4” is, what does ‘x’ do in the game? Auto: 4 (N/A), (Key: x) Button 10

If, say for Missile Command, I knew what key the three fire buttons were referenced as, then I could go and set the physical button numbers. So - that’s where I am now.


Some of the cores will adjust the button labels dynamically to match the game. E.g., instead of ‘button 1’ it will say ‘jab’ for Street Fighter. I think FBA does this, and maybe mame2003-plus…?


Yes there are button names in mame2003-plus for many games. We’re still in the process of adding the button names and volunteers are welcome! :slight_smile:


I do this function using Xpadder.

Basically I map L2 to Left Trigger and the X key in RA, then I map the X key to R2 in xpadder.

Gives me 2 Z-triggers on N64.


Great! A bit of a learning curve, but I’m all set now. I moved to 2003-plus and the button names helped a lot.

One side question. The only way I could figure out how to add the 2-player start button (to have 2-player play) was to add a 2nd USB controller. I have just one button connected to it - the 2nd player start. Is there a way to simulate the 2nd player start button on the 1st player controller? Not a big deal - just more junk and wires in the box.


No unfortunately at present you can not map buttons on more than one physical controller to a single RetroPad.

That comes up as a request on a somewhat regular basis – @hunterk do you know if there is a github issue already started to request it?


Not that I know of. I just did a quick search and didn’t see anything about it, but it’s hard to find specific issues sometimes.


I couldn’t find it either. Maybe time to make one :slight_smile:


New bounty: Multiple gamepads mapped to one RetroPad, and one gamepad to multiple RetroPads