Controller Mapping - Inconsistent from EmulationStation to Games
-
I'm having issues with setting up my controls under Emulation Station. I'm using the 2 person Xtension Control Board "Emulator Edition Plus" from Rec Room Masters for a controller. This controller has 3 modes, a keyboard mode, a "D Input Mode" and an "X Input Mode." (And I'm using a Pi3B and the version of RetroPie I just downloaded last week, the week ending on 2/15/20.
Naturally, once I plugged things in and got it all working, I was excited and tried to see if I could breeze through the setup without reading all the instructions. So I set up the 1st person controller. I don't remember setting up the 2nd person controller. I did read, later, that the controller shipped with the keyboard mode enabled by default. So it was probably pre-mapped to work.
I tried using the spinner knob for Tempest and it worked fine. But the trackball did not work for Centipede, so I started reading directions and poking around and, of course, now, I still have issues. I just couldn't be a good boy and leave it alone!
I've experimented with it in keyboard mode and D Input Mode. The latter (D Input) is supposed to work well with the Pi.
My biggest issue is that, now, when I move the joystick up, when I'm browsing through games for Mame Libretro, it moves the selection down one. If I move the joystick down, it does the same thing. I can use the 2nd player joystick and the selection moves up and down as it should. When I pick a game and play it, moving the stick up works properly, unlike in Emulation Station. So the 1st player joystick works incorrectly in Emulation Station and correctly in games. I've tried reconfiguring it several times and rebooting, but it still won't work correctly.
At this point, I have most things working well in keyboard mode, but have a few issues and questions:
- Where is the input configuration file? I'm assuming that it's in a text file format, like almost all Linux config files. I'm thinking I might be able to fix some problems if I edit by hand.
- Is there a link where I can get a copy of the config file as it is when you first start using RetroPie?
- Is it normal for a controller (the "up" on the joystick to work incorrectly in Emulation Station and correctly in the games?
- Is it possible to manually edit the configuration file to have two buttons do the same thing? (This controller has an extra set of A and B buttons that I want to map as the same as when Player 1 presses their A and B buttons - that will make navigating menus easier.)
-
@Tango said in Controller Mapping - Inconsistent from EmulationStation to Games:
My biggest issue is that, now, when I move the joystick up, when I'm browsing through games for Mame Libretro, it moves the selection down one. If I move the joystick down, it does the same thing. I can use the 2nd player joystick and the selection moves up and down as it should. When I pick a game and play it, moving the stick up works properly, unlike in Emulation Station. So the 1st player joystick works incorrectly in Emulation Station and correctly in games. I've tried reconfiguring it several times and rebooting, but it still won't work correctly.
Are the joysticks wired identically ? If they have the same name, then there's one configuration shared by both, so if one is wired differently w.r.t. joystick axis, it will not give the correct results.
Where is the input configuration file? I'm assuming that it's in a text file format, like almost all Linux config files. I'm thinking I might be able to fix some problems if I edit by hand.
It's in
\\retropie\configs\all\emulationstation
, namedes_input.cfg
.Is there a link where I can get a copy of the config file as it is when you first start using RetroPie?
By default, the default input configuration included doesn't have anything configured, it's an almost empty file. You can reset the configured inputs from the RetroPie-Setup if you want to start anew - https://retropie.org.uk/docs/EmulationStation/#controller-configs.
Is it normal for a controller (the "up" on the joystick to work incorrectly in Emulation Station and correctly in the games?
It could happen - in EmulationStation you set-up the joystick (as axis) and the directions, while the emulator input configuration only specifies the axis number, leaving to the emulator to figure out which direction is up/down/left/right.
Is it possible to manually edit the configuration file to have two buttons do the same thing? (This controller has an extra set of A and B buttons that I want to map as the same as when Player 1 presses their A and B buttons - that will make navigating menus easier.)
Yes, I think it should work if edit the
es_input.cfg
and add the button keycode and it's action as A/B buttons. -
@mitu said in Controller Mapping - Inconsistent from EmulationStation to Games:
@Tango said in Controller Mapping - Inconsistent from EmulationStation to Games:
My biggest issue is that, now, when I move the joystick up, when I'm browsing through games for Mame Libretro, it moves the selection down one. If I move the joystick down, it does the same thing. I can use the 2nd player joystick and the selection moves up and down as it should. When I pick a game and play it, moving the stick up works properly, unlike in Emulation Station. So the 1st player joystick works incorrectly in Emulation Station and correctly in games. I've tried reconfiguring it several times and rebooting, but it still won't work correctly.
Are the joysticks wired identically ? If they have the same name, then there's one configuration shared by both, so if one is wired differently w.r.t. joystick axis, it will not give the correct results.
At one point I tested this. Since Rec Room Masters recommends using D Input Mode instead of Keyboard Mode for a Pi based system, I wanted to see if the controls for Player 1 and Player 2 were, in the Keyboard Mode, mapping to the same things. So I dropped out of ES to the console and went through moving all the controls and watching. Different keys came up for the directions in the Player 1 joystick as for Player 2. And all the buttons mapped to different keys, too.
So I'd say both joysticks are wired the same, but are recognized as two different controls.
I could understand, more more easily, if the P1 joystick were inverted (up went down, down went up), or somehow the axis was switched (like left going up, right going down or the reverse), but the only two directions that produce action in ES are up and down - and both go down.
I'm going to study the config file you pointed out to me and manually edit it to see what I get.
...
Is it normal for a controller (the "up" on the joystick to work incorrectly in Emulation Station and correctly in the games?
It could happen - in EmulationStation you set-up the joystick (as axis) and the directions, while the emulator input configuration only specifies the axis number, leaving to the emulator to figure out which direction is up/down/left/right.
So there is actually more information for ES to use than for the emulators to use? Okay, again, that makes it sound like I can fix it with the cfg file. (That's one thing I LOVE about Linux - all the configs are editable!)
Is it possible to manually edit the configuration file to have two buttons do the same thing? (This controller has an extra set of A and B buttons that I want to map as the same as when Player 1 presses their A and B buttons - that will make navigating menus easier.)
Yes, I think it should work if edit the
es_input.cfg
and add the button keycode and it's action as A/B buttons.Great! Thank you!
-
I tried several experiments. I found that on regular EmulationStation menus, like the config menus, I had no problem moving up and down with the joystick. But once I pulled up a game list, either a list for Mame, or a list of favorites or most recently played, that's when I had a problem with not being able to use the joystick to move up through the list.
So the joystick worked fine in games and in most EmulationStation menus. The only time it was not working properly was when I was trying to navigate a list of games. (I'm wondering if there's a config option that might have to do with game listings that might be an issue.)
I fixed it by deleting es_input.cfg, then starting ES. It asked me to configure my input device and once I did, it worked fine.
On the last question of mine (#4), I'm running into trouble with trying to use two keys with the same mapping. I expected that after looking through es_input.cfg. It gave the actions first then the key IDs. That made me think they were indexed more by the function or action than by the actual key. I had this line in the config file generated by EmulationStation:
<input name="a" type="key" id="122" value="1" />
I copied it and changed the id to id="99" and inserted the new line as the last line in the cfg file. (So, to be clear, I had both of these lines in the file:
<input name="a" type="key" id="122" value="1" />
<input name="a" type="key" id="99" value="1" />Only the last line took. The first entry didn't work. This makes me think it's not possible to specify two keys do the same thing. (I hope I'm wrong, though!)
-
@Tango said in Controller Mapping - Inconsistent from EmulationStation to Games:
<input name="a" type="key" id="122" value="1" />
<input name="a" type="key" id="99" value="1" />I checked the sources and it doesn't seem supported, the last configured will always take priority and overwrite the previous ones.
-
So this was an actual, “You have to go to the source code” thing? Interesting.
Is this issue in the source for EmulationStation or something else? And what language is it in?
I would think, depending on how the data is handled in the program, it might not be too hard to add this in.
-
@Tango said in Controller Mapping - Inconsistent from EmulationStation to Games:
So this was an actual, “You have to go to the source code” thing? Interesting.
That was just for confirmation - otherwise it's just speculation.
Is this issue in the source for EmulationStation or something else? And what language is it in?
I don't see it as an issue if this was never intended to work like this. EmulationStation is a C++ application.
I would think, depending on how the data is handled in the program, it might not be too hard to add this in.
That can be true, but the gains IMHO are minimal and would cover only corner cases like yours.
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.