Help with L2 and R2 buttons in MAME

I’m having problems getting the L2 and R2 buttons to work as game button inputs in MAME.

It seems L2 and R2 correspond with the keyboard keys TAB and F11, which opens the MAME menu and displays the FPS respectively.

To prevent this from happening, I can go into the MAME user interface and remap the keys for TAB and F11, which now allows the L2 and R2 buttons to function as intended.

However this only works if the game is being played single player because it seems every controller input uses the same TAB and F11 keys as L2 and R2 which results in the same action being performed on multiple controllers rather than having unique keys for each button.

For example, if I map R2 as heavy kick in Street Fighter II for 2 different controllers, whenever one player presses it, it also triggers the second player’s heavy kick.

Is there any way to get around this?

FYI this is the MAME 2014 core.

You might be able to get around that limitation by remapping L3 and R3 to your pad’s triggers instead of the stick clicks in RetroArch. I’m not sure if those inputs are mapped as standard buttons like the face buttons and shoulders are.

I just tried that and it seems both L3 and R3 map to the same TAB and F11 keys as L2 and R2

Okay, so I’ve tried remapping L2 and R2 to different values in the Retroarch config, such as L3, R3, Right Stick X+, Right Stick Y+ etc

It seems that no matter what you bind those buttons to, MAME will always recognize L2 and R2 as TAB and F11 in addition to other keys such as F2 and F3 for L3 and R3.

I was wondering (still am actually) why MAME 2014 core was doing that! It seems so strange…

[QUOTE=truer;46543]Okay, so I’ve tried remapping L2 and R2 to different values in the Retroarch config, such as L3, R3, Right Stick X+, Right Stick Y+ etc

It seems that no matter what you bind those buttons to, MAME will always recognize L2 and R2 as TAB and F11 in addition to other keys such as F2 and F3 for L3 and R3.[/QUOTE] Did you turn off autoconfig enable in input settings? That’s probably overriding your remap, unless you are using the save remap option in quick menu, controls.

Since RetroArch is supposed to be a console-like experience, I think they mapped L2 and R2 to those functions to be easily accessible via the controller. And you couldn’t even use raw keyboard inputs when the libretro port first came out IIRC, so those RetroPad inputs were the only way to access the menu. I think now it’d make more sense to not have those be Tab and F1 by default, but the latest MAME core has a few worse problems that need to be fixed first.

I found this thread while troubleshooting my problem. I can’t seem to figure out how to configure two players in MAME with two controllers of the same type. L2 and R2 are mapped to the same ‘key’ in MAME and I cant figure out how to change the default keymapping. Are these keys hard coded somehow, or is there a configuration file for the retroarch to mame keymapping?

You guys wanna hear something funny?

I was trying to fix the resolution by messing around in the menu (Tab or R2) and accidentally clicked to re-map the “open menu” button. I tried pressing everything but nothing was recognized. Then I tried pressing stuff on the keyboard and accidentally closed the menu with “none” assigned to open it.

Now I can’t open the menu because I have de-mapped it and have no clue whatsoever how to re-map it even through files (I’m doing a hell lot of searching but no luck)

have you can tried to search the relating mame-config file and deleted them? Think the default settings for Mame-Hotkey/GUI thing are predestinated for such a mess :frowning:

There should be a mame folder where your ROMs are, which has a cfg folder in it. Delete default.cfg to reset your general inputs. If you have a save directory set in RetroArch the mame folder will be there instead.

Just beating this dead horse once more because it keeps tripping me up. I did some digging into github. The following buttons are hard-coded in MAME, MAME2016, MAME2014 cores as far as I can tell:

RETROPAD_L2: TAB RETROPAD_R2: F11 RETROPAD_L3: F2 RETROPAD_R3: F3

Which is fine, except when you try and map one of these buttons for a 6+ button layout with 2+ players. If any player pushes one of these buttons, then it’s mapped to all other players buttons as well, which is pretty annoying.

I opened an issue here. It would be much better if these were defaulted to those keys in the default mame.cfg rather than hard-coded into the core.

They’re not hard-coded anymore in the most up to date Mame (without date at the end).