Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lr-imame4all in game Config Menu (Tab Key) doesn't work #25

Open
Wilstorm opened this issue Jul 20, 2016 · 15 comments
Open

lr-imame4all in game Config Menu (Tab Key) doesn't work #25

Wilstorm opened this issue Jul 20, 2016 · 15 comments

Comments

@Wilstorm
Copy link

Wilstorm commented Jul 20, 2016

The in game emulator Config Menu which is by default accessed with the Tab Key doesn't work. It's a very useful feature and without the Config Menu several useful features and options are not available. One of the main features that doesn't work (Input (general)) to setup for 4-players on joysticks as you can not configure players 2-4 inputs, Coin-in 2-4, Player start 2-4.

You need access to the Config Menu (via keyboard TAB) to setup access to the Config Menu with a joystick.

You also loose the ability to do more granular settings (Input (this Game)) for specific games as some do not work with the default keys.

You also loose the Dip Switch settings which allow you to set number of coins to start a game, number of lives, difficulty, time to play, etc. for a game.

Game Information such as history.dat is not accessible without the Config Menu.

Lastly not used as often would be Bookkeeping Info and Reset Game.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@markwkidd
Copy link
Contributor

@Wilstorm could you download the most recent buildbot version of this core, or recompile it from source? You should find that the TAB key is working now, along with L2 on the "retropad" abstraction

@Wilstorm
Copy link
Author

Wilstorm commented Oct 5, 2017

Tab does work but it's buggy. I can press tab and the menu comes up. I press tab again and it exits. That works fine.

  1. The issue is when I press enter on "Input (general)" (the first menu option) nothing happens. Enter is the correct key to enter a menu and the field is defined as "UI Select" under "Input (general) and it shows that it is configured with "ENTER or JS 4" which is correct but it doesn't work. Well enter is correct I don't know about "JS 4". It's possibly related to a joystick button which would be handy too for joystick only gamers. What does work to enter menus and fields is lalt (left-alt is MAME's button 2 by default).

  2. If I want to define the "Config Menu" button I press lalt (which should be enter as defined by "UI Select" from issue 1 above) and it waits for input. The usual button is TAB so when press TAB it populates this in the field "E Q W TAB" instead of just "TAB" but tab does work to enter and exit the menu while in game just fine.

  3. The only field input key that works seems to be tab. Let's say I want to configure Pause with a P or Reset Game with F3 I can't because no other keys work on the keyboard. It looks like tab is the one and only option that works when populating a field.

  4. I can not press escape to exit a field. I have to enter something (only tab works). Escape is needed to exit a field without changes and pressing double escape within about a second is used to set a field to "NONE" which is NUL or no input.

  5. "UI Cancel" under "Input (general)" is set to ESC but doesn't work. This allows you to back out of a menu. If I am down 2 levels deep I can press escape to come up one level and press it again to come up one more back to the 1st level/main menu. Tab opens and closes the menu from where you are located in the menu structure. If I am down 2 levels deep I can press tab to open and close that level at 2 deep. If I want to go up one level I have to exit the game and restart. Basically I can drill down but not back up.

  6. UI Up, UI Down, UI Left, UI Right, UI Home, UI End, UI Select, UI Cancel & UI Clear are menu navigation keys under "Input (general)" that currently don't seem to be working. They are important for navigating the menus and also field input entry.

When downloading the source I saw several "variable set but not used" messages.

@markwkidd
Copy link
Contributor

@r-type I wanted to tag you so that you can see this detailed report related to your work on #50

If you don't have time to work on this, I might be able to however I know any work I do would go faster if you wanted to describe what it would take.

@r-type
Copy link
Contributor

r-type commented Oct 6, 2017

I have only enable key tab.
Looking at the code said that only 5 and 6 keys (+tab)
Is handled. The rest is only joystick binding.
If we want other key we have to backport a keyboard handler like
In the more recent mame core. For my part Not having time to look at this for now.

@markwkidd
Copy link
Contributor

Thank you @r-type -- that is helpful. Maybe I will have time to look at the 'retro keyboard' handler in mame2003 in a few days for inspiration: https://github.com/libretro/mame2003-libretro/blob/master/src/libretro/keyboard.c

@r-type
Copy link
Contributor

r-type commented Oct 6, 2017

quick bad hack could be something like this
https://pastebin.com/eVvLJBPt

@markwkidd
Copy link
Contributor

@r-type I compiled and executed your patch. On this Windows laptop at least I can now assign keys other than Tab to functions in the MAME OSD.

Do you want to submit a PR?

@r-type
Copy link
Contributor

r-type commented Oct 15, 2017

ok PR done

@markwkidd
Copy link
Contributor

@Wilstorm once you have a chance to install today's mame2000 update by r-type can you check its functionality in your environment?

@markwkidd
Copy link
Contributor

@Wilstorm the latest PRs also improve support for mapping the Tab menu a joypad button.

@Wilstorm
Copy link
Author

Wilstorm commented Nov 13, 2017

I just downloaded from source and it's looking much much better. There's a still a few issues.

  1. Certain keys that seems to be "dual" mapped for lack of better words (keys MAME uses by default) are causing issues. This is just an illustrative example. If I decided to update the Pause key and use say "LCTRL" it populates the field with "LCTRL JS4". It adds a joystick entry to the end. It should be just "LCTRL". This happens with several keys. Here's some examples that populate the field with extraneous characters. "LCTRL JS4", "ALT JS4", "LSHIFT JS6", "Z JS8" & "X JS9".

If it's not a default MAME key it works fine. So if decided to update the Pause key with E. It works fine.

  1. Surprisingly "not" mapping works partially. This issue has similar characteristics as example 1. Certain keys that seems to be "dual" mapped for lack of better words (keys MAME uses by default) are causing issues. Sticking with the same example if I want to change my Pause key to E it works fine. If I want to change it to E but not W it works fine too.

To enter the more advanced configuration I would press E and followed by W twice in quick succession (like a second or so). The field populates with "E not W". The "not" operator is basically work like this. If I press E and not W then Pause the game. The "not" operator allows for much more advanced configurations in games and also more key combinations with the keyboard and joystick.

Here's the "dual mapped" issue (using MAME default keys). Now if I want to make Pause key E but not LCTRL (MAME default button 1) I would press E followed by LCTRL twice quickly. In mame2000 it shows "E LCTRL JS4 LCTRL JS4" and it should be "E not LCTRL". Basically if it's a "dual mapped" key it ignores the "not" and populates the field twice with the MAME default key and the joystick key.

In mame4all-pi it shows proper with "E not LCTRL". This is the same issue lr-mame2003 suffers from with "ghost" entries in the field and the "not" operator not working at all.

  1. This issue is not a deal breaker at all but I wanted to throw it out there as it's the way I remember mame4all working. If I press enter to change a field but decided to not make a change I could press escape and it would leave the field as is. If you pressed any other key besides escape then it treats it as a change.

If I wanted to set the field to "NONE" I would press escape twice (within a second or so). If not in rapid succession it would be treated as a regular escape key sequence. When I press escape twice real fast now it just backs me out of the menus real fast. :)

Here's where it's a bit fuzzy and more of icing on the cake then needed. If the field was set to "NONE" with double escape and you did it a second a time by pressing (enter followed by double escape) it would set it back to defaults.

Like Pause for example (picking on the pause key again). if I changed the Pause key to "NONE" with double escape and then while it's set to "NONE" if I pressed enter again and pressed escape twice in rapid succession it would default back to "P". Basically setting it to "NONE" twice in a row reverted back to the default. It was very useful setting keys back to the defaults.

I don't have my joystick handy but will test it out here later today and post an update.

@Wilstorm
Copy link
Author

Wilstorm commented Nov 13, 2017

Updated comment as it was removing the "less than symbol" the word not followed by the "greater than symbol".

@Wilstorm
Copy link
Author

Wilstorm commented Nov 14, 2017

Referencing issue #3 above. I think the paragraph below is incorrect. I will try and explain but it's a bit confusing but it has always worked well on mame4all-pi.

INCORRECT I THINK: If I press enter to change a field but decided to not make a change I could press escape and it would leave the field as is. If you pressed any other key besides escape then it treats it as a change.

  1. I believe if you pressed the escape key once (while in entry mode) it would assign the escape key to the function.

  2. Pressing it twice would set the field to "None".

  3. Setting a field to "None" and then setting it to "None" a 2nd time would change it to the default key(s). Basically setting it to "None" twice sets it back to the defaults.

As it sits now if you want to use the escape key in a function you have to enter it first. If it's entered later it wipes the field out.

  1. Press enter on field
  2. Press escape and it will set it to "None".
  3. Press enter on same field a 2nd time
  4. Press escape a 2nd time and it will set field to "ESC"
  5. Press enter on field 3rd time and enter additional key (joystick button or whatever you wish). This allows you to set multiple keys and buttons for a single function. Such as exit the emulator with escape but also a button on the joystick or a 2nd keyboard key.

If you do it in reverse for example on the Pause key it doesn't work.

  1. Press enter on field
  2. Press P
  3. Press enter on field a 2nd time
  4. Press escape (at this point the entire field is set to "None")

Basically escape has to be entered first if you wish to have multiple keys for the same function. I believe that's why it was setup with the double escape key sequence.

Just an FYI. If you leave a line and such as arrow up or down, then arrow back to the same line and press enter it wipes out the field which is how it always works. You have to stay on that line pressing enter and adding the keys you wish to use. If you leave a line and decide to add another key you have to start over. This works properly but I thought it might help in understanding the issue.

  1. A fourth issue that might be related. When playing a game if you press escape it locks the game up instead of exiting. The MAME emulator exit key is what "UI Cancel" is set to I believe. The only way to exit at that point is "Select" + "Exit".

@Wilstorm
Copy link
Author

One last thought on the escape key behavior. I believe the double escape key press sequence would have been implemented to allow a single escape key press to be used as a regular key when setting up the function/navigation keys.

@markwkidd
Copy link
Contributor

These testing notes are great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants