Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Controller Configuration Information - Altering It and Config Hierarchy



  • When first booting a RetroPie image, EmulationStation makes you set up the controller and stores the information in /opt/retropie/configs/all/emulationstation/es_input.cfg. After this is set up, I know the data for the control buttons or keyboard keys is kept in /opt/retropie/configs/all/retroarch.cfg.

    Ultimately, I'm looking at changing some of the button mapping, but I'm trying to see just what data is the "original" source for controller mapping. Is es_input.cfg the main source for how a controller's buttons (or keys, if it's keyboard based) are mapped? Or when I set up a controller, does it update the data in both es_input.cfg and retroarch.cfg at the same time? Or is one file the "master" and the settings in that file are used for other files?

    And, along with that, is it possible to map a button on a controller so it's taken as a keypress by emulators or emulation station? For instance, if I have a button on the controller labelled "Menu," can I alter the cfg files so that button is seen as a keyboard key by EmulationStation or by emulators? And, on that note, if I can do that, can I make one button be seen as a combination of pressing the hotkey and another button?

    If I'm not being clear, please let me know.


  • Global Moderator

    Much of the info asked here can be found in https://retropie.org.uk/docs/RetroArch-Configuration/, just in case you missed it.

    After this is set up, I know the data for the control buttons or keyboard keys is kept in /opt/retropie/configs/all/retroarch.cfg.

    For gamepads it's a separate .cfgfile created under /opt/retropie/configs/all/retroarch-joypads, named after the name of the controller configured. For keyboards, it's directly in that file.

    Ultimately, I'm looking at changing some of the button mapping, but I'm trying to see just what data is the "original" source for controller mapping. Is es_input.cfg the main source for how a controller's buttons (or keys, if it's keyboard based) are mapped?

    No, the mapping happens at configuration time, from ES, based on the values you choose during the input configuration screen.

    Or when I set up a controller, does it update the data in both es_input.cfg and retroarch.cfg at the same time? Or is one file the "master" and the settings in that file are used for other files?

    Yes, both files are modified with the values chosen during setup, and no - there's no 'master' file.

    And, along with that, is it possible to map a button on a controller so it's taken as a keypress by emulators or emulation station? For instance, if I have a button on the controller labelled "Menu," can I alter the cfg files so that button is seen as a keyboard key by EmulationStation or by emulators?

    Only if the gamepad is a keyboard.

    And, on that note, if I can do that, can I make one button be seen as a combination of pressing the hotkey and another button?

    Only if you disable the hotkey in RetroArch. There are options though, outside of RetroArch's hotkey binds, like using the triggerhappy program and calling a script which sends the command to RetroArch via the Network control interface.



  • @mitu said in Controller Configuration Information - Altering It and Config Hierarchy:

    Much of the info asked here can be found in https://retropie.org.uk/docs/RetroArch-Configuration/, just in case you missed it.

    After this is set up, I know the data for the control buttons or keyboard keys is kept in /opt/retropie/configs/all/retroarch.cfg.

    I compartmentalize, sometimes. I'm doing this while dealing with a few other things going on, so I have read about RetroArch, but I also went through the parts I needed. It's hard to keep up with everything until it all fits together "in my head." So thanks for the gentle reminder - I'll check that.

    For gamepads it's a separate .cfgfile created under /opt/retropie/configs/all/retroarch-joypads, named after the name of the controller configured. For keyboards, it's directly in that file.

    Does "gamepad" basically mean any device that uses buttons and joysticks, as opposed to a keyboard?

    Ultimately, I'm looking at changing some of the button mapping, but I'm trying to see just what data is the "original" source for controller mapping. Is es_input.cfg the main source for how a controller's buttons (or keys, if it's keyboard based) are mapped?

    No, the mapping happens at configuration time, from ES, based on the values you choose during the input configuration screen.

    So I'd have to change both config files if I knew of one thing I wanted to edit? Both es_input.cfg and retroarch.cfg?

    Is it possible to get the controller to work one way in EmulationStation and another way in all games? For instance, if I make changes to es_input.cfg, would that change only how things work in ES, with retroarch.cfg still defining how things are controlled within emulators? (I do see, at this point, that within AdvMame, I can basically define the buttons to work any way I want them to, so that would be an exception.)

    Or when I set up a controller, does it update the data in both es_input.cfg and retroarch.cfg at the same time? Or is one file the "master" and the settings in that file are used for other files?

    Yes, both files are modified with the values chosen during setup, and no - there's no 'master' file.

    So I could, theoretically, modify the files for separate purposes?

    And, along with that, is it possible to map a button on a controller so it's taken as a keypress by emulators or emulation station? For instance, if I have a button on the controller labelled "Menu," can I alter the cfg files so that button is seen as a keyboard key by EmulationStation or by emulators?

    Only if the gamepad is a keyboard.

    So if it's not a keyboard, there's no way to make a button look like a keypress?

    And, on that note, if I can do that, can I make one button be seen as a combination of pressing the hotkey and another button?

    Only if you disable the hotkey in RetroArch. There are options though, outside of RetroArch's hotkey binds, like using the triggerhappy program and calling a script which sends the command to RetroArch via the Network control interface.

    Thanks. I'll look into it. If I disable the hotkey in RetroArch, does it affect anything in EmulationStation, or only in the games?


  • Global Moderator

    [..]

    For gamepads it's a separate .cfgfile created under /opt/retropie/configs/all/retroarch-joypads, named after the name of the controller configured. For keyboards, it's directly in that file.

    Does "gamepad" basically mean any device that uses buttons and joysticks, as opposed to a keyboard?

    No, it's based on how the device is detected by the OS as an input device, not the physical appearance.
    [..]

    So I'd have to change both config files if I knew of one thing I wanted to edit? Both es_input.cfg and retroarch.cfg?

    Yes.

    Is it possible to get the controller to work one way in EmulationStation and another way in all games? For instance, if I make changes to es_input.cfg, would that change only how things work in ES, with retroarch.cfg still defining how things are controlled within emulators? (I do see, at this point, that within AdvMame, I can basically define the buttons to work any way I want them to, so that would be an exception.)

    Yes, but these mappings would be changed if you re-configure your gamepad/device in EmulationStation again. You can, however, disable the auto-configuration in the RetroPie settings, so only es_input.cfg would be generated once you do the configuration.

    So I could, theoretically, modify the files for separate purposes?

    Yes.

    So if it's not a keyboard, there's no way to make a button look like a keypress?

    Not with just a simple configuration.



  • My controller has controls for 2 players, plus extra buttons in a separate location labeled A, B, A2, B2. There's also a section with 10 other buttons, with some labeled Select (generally the hot key, too), Coin One, Coin Two, Player 1, Player 2, Menu, Pause, and Exit.

    What I was thinking was that it would be nice to use the extra four A, B, A2, B2 buttons for the controls in EmulationStation. Menu could replace Select-Player1 and pull up that menu, and Exit, of course, would drop into the command line (or maybe reboot).

    From what you're saying, it sounds like I can do this by manually editing es_input.cfg - as long as someone doesn't come along and clobber that config with a new one. (But, of course, I'd keep a backup - and when I have people over, I put it in Kiosk or Kid Mode.) Then I can also edit retroarch.cfg separately for the emulators (other than ones like AdvMame, that use their own configuration file).

    Am I right about this? (I want to make sure I'm clear and understand what you're saying.)


Log in to reply
 

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.