libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.11k stars 1.82k forks source link

Hotkey blocking button function in MAME/FBA cores #2230

Closed dankcushions closed 8 years ago

dankcushions commented 8 years ago

Hi :)

With all non-arcade cores I've tested, there appears to be no issue with having the hotkey bound to a button with a normal function. For example, I use SNES USB controllers and use the select button as my hotkey. In SNES/NES cores, the select button functions in the game as usual (eg, to select 1 or 2 player in Super Mario), but also does all the extra hotkey functions, like select+start = quit, select+Y= retroarch GUI.

However, with every single MAME/FBA core I'm able to run (Raspberry Pi 2 + Retropie), the select button does not do its insert coin function in SOME games. Insert coin works fine if I bind it to a different button to the hotkey, but with an 8 button controller that just means you have a new problem (eg, in SFII I get a new credit every time I heavy kick :))

There are previously raised issues with the cores themselves: https://github.com/libretro/mame2003-libretro/issues/8 https://github.com/libretro/fba-libretro/issues/46 https://github.com/libretro/imame4all-libretro/issues/9 ...but according to your forums, it sounds like this is intentional (http://libretro.com/forums/showthread.php?t=4184&p=29268)? This seems wrong to me as it would mean users would not be able to use NES/SNES/PSX etc controllers in their respective cores, because you wouldn't have a spare button for a hotkey.

So my thought is that this is a core retroarch issue, where apparently the hotkey intentionally blocks the hotkey button's regular function (at least, in some cores/scenarios). Can this be changed?

HerbFargus commented 8 years ago

I apologise, I meant the code from @joolswills I know the way it runs now is that it blocks everything but my take is his patch will block everything but the hotkey if I understand it correctly. (at least as it is intended to work, not how it is currently working from my testing)

joolswills commented 8 years ago

Sounds like my code is buggy anyway - Will look at it when I'm next free :)

HerbFargus commented 8 years ago

the issue seems to be controller specific or core specific or both as I've been getting varying results:

Logitech f310

snes-9x-next:

Super Mario World:

Hotkey not blocked, but secondary keypresses are blocked.

lr-fba-next (libretro-fba)

1943kai:

hotkey blocked (no coin insert) but multiple keypresses work (can save, exit etc.)

logitech config: http://pastebin.com/3ATdrVbM

USB Snes Controller

snes-9x-next

super mario world:

hotkey and secondary keypresses not blocked (menus open up on save state, etc)

lr-fba-next (libretro-fba)

1943kai:

hotkey not blocked (can insert coins with select no problem) and multiple keypresses work (can save, exit etc.)

the shoot button for the first player fired for both the first and second player... not sure if that is related to the recently changed code/ gamepad/ or rom. kinda odd

snes config http://pastebin.com/f1uf8e86

With all the varying results I'm almost wondering if it would be best to keep the default hotkey coding and then come up with some simple hacks just to address the coin insert function in fba and mame as those seem to be the main systems this is an issue for. just some thoughts.

joolswills commented 8 years ago

recalbox are using a workaround for this based on waiting on a counter before blocking (written by @Kivutar)

We are going to include this in retropie also (with a few minor changes)..

Basically this - https://github.com/libretro/RetroArch/compare/master...joolswills:hotkey_hack

it was mentioned here that a delay based fix wasn't really wanted, so I'll just leave this post - but if it would be considered I can open a pull request

PhoenixWright commented 8 years ago

There's something else I noticed that may be related to this issue, although I'm unsure and am just now starting to glance at the codebase.

When using the new fba core, and only on certain games, I notice that under the Controls settings User 1 Coin is missing entirely.

As @fr500 mentioned could be implemented, the immediate thing I thought to do as a user was toggle the hotkey functionality entirely. Has this been implemented, or is that a good thing to look into? I'm playing with a GameVice controller on iOS, which I have a gut feel is going to be growing in popularity over time (as well as this repo itself!) so, although I definitely understand the recommendations around controllers with enough buttons, I also feel that there must be an elegant solution to this problem.

From a UI perspective, augmenting controller input with touch input or areas on the screen is one thing I thought of. For instance, it would be nice on iOS to be able to designate an area of the screen as L3/R3 as well as, perhaps, the hotkey functionality. For instance, while mapping buttons, it would be so awesome to be able to tap areas of the screen and have those map to buttons. I even tried this the first time I ran the binding utility. I have not looked at the retropad-related code to understand if this is too far out there from an implementation standpoint. And I hate to say that while I've looked through quite a few options, perhaps this is already possible and I missed the options entirely.

kivutar commented 8 years ago

If this patch is used without causing issues by both recalbox and retropie, we could upstream it.

But I remember it was quite a hack to workaround a design issue in arcade games.

Nukethepeace commented 6 years ago

I have exactly the same issue with Retroarch 1.7.3 on x64 Windows 10 in the MAME 0.193 core (tested down to mame2010 libretro core). Is there a way how I can fix this without changing the hotkey from select to another? Is there some kind of a hotkey hack on for the x64 version of Retroarch?