Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    Change EmulationStation gamepad keyboard mapping

    GamePad/GPIO/USB encoder
    gamepad keyboard mapping
    1
    3
    4479
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dj0144
      dj0144 last edited by

      I'm running the latest supported build of Recalbox with the controls connected to RPI4 through an Ultimarc Mini-PAC. Recalbox interprets joysticks and action buttons as keyboard keys. This is good.

      Here's the problem. EmulationStation assigns the virtual gamepad buttons to different keyboard keys than my Mini-Pac. For example, EmulationStation maps virtual gamepad button 'A' to keyboard key 'S', but my Mini-Pac is programmed to send keyboard key '1' instead of sending keyboard key 'S'.

      I could reprogram the Mini-PAC to send 'S' instead of '1' when pressing that action button on my controller, but I would like to modify EmulationStation configuration instead. Is there a supported way to change the default keyboard mappings in EmulationStation? For example, can EmulationStation be configured to map virtual gamepad button 'A' to keyboard key '1' instead of keyboard key 'S'? If so, is there a way to make this the default mapping for all games?

      dj0144 1 Reply Last reply Reply Quote 0
      • dj0144
        dj0144 @dj0144 last edited by

        I resolved this issue on my own. Confirmed with libretro/nestopia and libretro/picodrive.

        1. Connect a physical USB gamepad such as an Xbox controller for navigating ES menus.
        2. Launch a core and open the ES menu.
        3. Go up to Main Menu -> Settings -> Input -> Port 1 Controls.
        4. Using the physical USB gamepad, select each input and map an encoded keyboard control, e.g., map virtual gamepad "A" to keyboard key '1'.
        5. Go up to Main Menu -> Configuration File -> Save New Configuration. The file will be saved to /recalbox/share/system/.config/retroarch/config/corename.cfg.
        6. Copy the new configuration file to /recalbox/share/system/configs/retroarch/system.cfg, e.g., "nes.cfg" for libretro/nestopia. For more information about this step, see the "Manual modification" section of "Create a custom configuration per emulator" on the wiki.
        dj0144 1 Reply Last reply Reply Quote 0
        • dj0144
          dj0144 @dj0144 last edited by dj0144

          To modify the EmulationStation menu mapping, edit the file /recalbox/system/.emulationstation/es_input.cfg. In the 'deviceName="Keyboard"' section, set the 'id' property of each input to the SDL keycode for that keyboard input. To map virtual gamepad button "a" to keyboard key "1", locate the input with 'name="a"' and change the value of 'id' to "49".

          <input name="a" type="key" id="49" value="1" code="168" /> <!-- gamepad a ==> keyboard 1 -->

          [EDIT] In this example, the SDL keycode for keyboard key "1" is 49. SDL keycodes are listed here - https://wiki.libsdl.org/SDL2/SDLKeycodeLookup.

          1 Reply Last reply Reply Quote 0
          • Referenced by  mcj2115 mcj2115 
          • Locked by  admin admin 
          • First post
            Last post

          Want to support us ?

          68
          Online

          98.6k
          Users

          28.1k
          Topics

          187.0k
          Posts

          Copyright © 2021 recalbox.com