RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    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

    Guide: Advanced Controller Mappings

    Scheduled Pinned Locked Moved Help and Support
    joystickcontrollermappingxboxdrvscummvm
    626 Posts 35 Posters 463.7k Views
    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.
    • H
      Hubz @spud11
      last edited by

      @spud11 Thanks a ton for the list! BTW I ran into that same error too with the devicename not working when having spaces in it. Glad to know I wasn't crazy and it happened to others as it took me forever to troubleshoot.

      S 2 Replies Last reply Reply Quote 0
      • S
        spud11 @Hubz
        last edited by

        @Hubz No problems. It was mediamogul who picked it up.

        RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

        1 Reply Last reply Reply Quote 0
        • mediamogulM
          mediamogul Global Moderator
          last edited by

          Glad to see things working out here. I'll add the information about --device-name to the guide .

          RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

          S 1 Reply Last reply Reply Quote 0
          • S
            spud11 @mediamogul
            last edited by

            @mediamogul That's a good idea.

            I'm still having a bit of trouble as per 3 posts ago. Hoping you might still be able to help, if possible, please.

            RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

            mediamogulM 1 Reply Last reply Reply Quote 0
            • mediamogulM
              mediamogul Global Moderator @spud11
              last edited by mediamogul

              @spud11

              Have those particular virtual controllers been mapped through Emulation Station like any other controller? If not, it could be that there's no automatic configuration for them at /opt/retropie/configs/all/retroarch/autoconfig for RetroArch to draw on.

              RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

              S 1 Reply Last reply Reply Quote 0
              • S
                spud11 @mediamogul
                last edited by spud11

                @mediamogul Hi. Yes, they are in fact both mapped:

                Player_3_-_4-Way_Joystick_xboxdrv.cfg

                input_driver = "udev"
                input_device = "Player_3_-_4-Way_Joystick_xboxdrv"
                input_b_btn = "1"
                input_y_btn = "3"
                input_select_btn = "8"
                input_start_btn = "9"
                input_up_axis = "+0"
                input_down_axis = "-0"
                input_left_axis = "+1"
                input_right_axis = "-1"
                input_a_btn = "0"
                input_x_btn = "2"
                

                Player_4_-_4-Way_Joystick_xboxdrv.cfg

                input_driver = "udev"
                input_device = "Player_4_-_4-Way_Joystick_xboxdrv"
                input_b_btn = "1"
                input_y_btn = "3"
                input_select_btn = "8"
                input_start_btn = "9"
                input_up_axis = "+0"
                input_down_axis = "-0"
                input_left_axis = "+1"
                input_right_axis = "-1"
                input_a_btn = "0"
                input_x_btn = "2"
                

                And thinking about it, I'll need to map the corresponding 8 way configs to Users 7 and 8 in Retroarch too, given that all other roms will rely on those 8 way configs. Personally, I'd just prefer for the xpad (rather than xboxdrv) driver to work for normal 8 way mame-libretro joystick games, but when I added the hash to the below, xboxdrv wouldn't load at all:

                ;;
                			*) # Configuration for every other ROMs on this emulator
                				$xboxkill
                				# joycommand="$basic $joy3unrestricted & $basic $joy4unrestricted &"
                				# eval $joycommand
                                              ;;
                

                I've also tried to edit, without success, the individual amidar.zip.cfg file which is as follows by adding the extra line at the top:

                # Settings made here will only override settings in the global retroarch.cfg if placed above the #include line
                
                input_player3_joypad_index = 5
                video_allow_rotate = "true" 
                video_rotation = "3" 
                aspect_ratio_index = "19" 
                video_aspect_ratio_auto = "false" 
                video_aspect_ratio = "1.75"
                
                #include "/opt/retropie/configs/all/retroarch.cfg"
                

                RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                mediamogulM 1 Reply Last reply Reply Quote 0
                • mediamogulM
                  mediamogul Global Moderator @spud11
                  last edited by

                  @spud11

                  You may just want to map those final two controllers for keyboard input. I have most of my controllers mapped like that anyway. RetroArch will still respect all the controller button mappings, but have a separate set for keyboard keys as well. An example of one and two player keyboard controls from my own retroarch.cfg is:

                  input_player1_a = "a"
                  input_player1_b = "b"
                  input_player1_y = "y"
                  input_player1_x = "x"
                  input_player1_start = "t"
                  input_player1_select = "e"
                  input_player1_l = "l"
                  input_player1_r = "r"
                  input_player1_left = "left"
                  input_player1_right = "right"
                  input_player1_up = "up"
                  input_player1_down = "down"
                  input_player1_l2 = "d"
                  input_player1_r2 = "f"
                  input_player1_l3 = "c"
                  input_player1_r3 = "v"
                  
                  input_player2_a = "k"
                  input_player2_b = "m"
                  input_player2_y = "o"
                  input_player2_x = "n"
                  input_player2_start = "num9"
                  input_player2_select = "num0"
                  input_player2_l = "p"
                  input_player2_r = "q"
                  input_player2_left = "g"
                  input_player2_right = "h"
                  input_player2_up = "i"
                  input_player2_down = "j"
                  input_player2_l2 = "s"
                  input_player2_r2 = "u"
                  input_player2_l3 = "w"
                  input_player2_r3 = "z"
                  

                  RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                  S 1 Reply Last reply Reply Quote 0
                  • D
                    dunnieboy
                    last edited by dunnieboy

                    So far I am mainly using this for dosbox to capture the mouse. Are there reason to use this as the main controller rather than the xpad default mapping ?

                    The systems I am suing are :
                    DosBOX
                    Vice (C64)
                    Amiberry (amiga)
                    Daphne (Dragon's Lair)
                    Mame 2003

                    I am currently initiating the xboxdrv in the .sh of each game for DosBOX.

                    Thanks

                    1 Reply Last reply Reply Quote 0
                    • S
                      spud11 @mediamogul
                      last edited by spud11

                      @mediamogul Hi. I had my input references slightly wrong ( input_player1_joypad_index = 4 ). I'm assuming the 4 corresponds to User 5's input in Retroarch (which in my case is now mapped to Player_3_-4-Way_Joystick_xboxdrv) and 5 corresponds to User 6's input in Retroarch (mapped to Player_4-_4-Way_Joystick_xboxdrv). So I have amended the input indexes below to reflect that.

                      Adapting your code, to change the settings for Amidar only at the moment, I would just change amidar.zip.cfg as follows:

                      # Settings made here will only override settings in the global retroarch.cfg if placed above the #include line
                      
                      input_player1_joypad_index = 4
                      input_player1_a = "a"
                      input_player1_b = "b"
                      input_player1_y = "y"
                      input_player1_x = "x"
                      input_player1_start = "t"
                      input_player1_select = "e"
                      input_player1_left = "left"
                      input_player1_right = "right"
                      input_player1_up = "up"
                      input_player1_down = "down"
                      
                      input_player2_joypad_index = 5
                      input_player2_a = "k"
                      input_player2_b = "m"
                      input_player2_y = "o"
                      input_player2_x = "n"
                      input_player2_start = "num9"
                      input_player2_select = "num0"
                      input_player2_left = "g"
                      input_player2_right = "h"
                      input_player2_up = "i"
                      input_player2_down = "j"
                      
                      video_allow_rotate = "true" 
                      video_rotation = "3" 
                      aspect_ratio_index = "19" 
                      video_aspect_ratio_auto = "false" 
                      video_aspect_ratio = "1.75"
                      
                      #include "/opt/retropie/configs/all/retroarch.cfg"
                      

                      After that, I would just remap the buttons in game with the TAB menu?

                      Thanks.

                      RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                      mediamogulM 1 Reply Last reply Reply Quote 0
                      • mediamogulM
                        mediamogul Global Moderator @spud11
                        last edited by mediamogul

                        @spud11 said in Guide: Advanced Controller Mappings:

                        After that, I would just remap the buttons in game with the TAB menu?

                        After that, RetroArch just assumes the keyboard presses are coming from it's own "Retropad" controller as the proper button presses, so it'll work without any further remapping.

                        RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                        S 2 Replies Last reply Reply Quote 0
                        • S
                          spud11 @mediamogul
                          last edited by

                          @mediamogul Thanks, mediamogul. Will try later in the day and let you know how I go.

                          RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                          1 Reply Last reply Reply Quote 0
                          • S
                            spud11 @mediamogul
                            last edited by

                            @mediamogul Hi. I've now tried the approach of mapping the keys, but no luck. Nothing works automatically.

                            # Settings made here will only override settings in the global retroarch.cfg if placed above the #include line
                            
                            input_player1_joypad_index = 4
                            input_player1_a = "a"
                            input_player1_b = "b"
                            input_player1_y = "y"
                            input_player1_x = "x"
                            input_player1_start = "t"
                            input_player1_select = "e"
                            input_player1_left = "left"
                            input_player1_right = "right"
                            input_player1_up = "up"
                            input_player1_down = "down"
                            
                            input_player2_joypad_index = 5
                            input_player2_a = "k"
                            input_player2_b = "m"
                            input_player2_y = "o"
                            input_player2_x = "n"
                            input_player2_start = "num9"
                            input_player2_select = "num0"
                            input_player2_left = "g"
                            input_player2_right = "h"
                            input_player2_up = "i"
                            input_player2_down = "j"
                            
                            video_allow_rotate = "true" 
                            video_rotation = "3" 
                            aspect_ratio_index = "19" 
                            video_aspect_ratio_auto = "false" 
                            video_aspect_ratio = "1.75"
                            
                            #include "/opt/retropie/configs/all/retroarch.cfg"
                            

                            The joypad index numbers are correct - 4 and 5 - reflect the 2 4-way xboxdrv scripts.

                            I also inserted the same values (as above) in the main retroarch.cfg file. They worked in the Retroarch menu in emulationstation, as the "x" and "y" keys had become "a" and "b", as per the script.

                            I'm clearly missing something along the line somewhere, but just not sure what. Now that I've mapped the keys in Retroarch, should I also be changing the xboxdrv scripts in some way too?

                            RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                            mediamogulM 1 Reply Last reply Reply Quote 0
                            • mediamogulM
                              mediamogul Global Moderator @spud11
                              last edited by mediamogul

                              @spud11

                              Now that I've mapped the keys in Retroarch, should I also be changing the xboxdrv scripts in some way too?

                              You'll need to make sure the intended controllers are mapped to the corresponding keyboard keys that match your new RetroArch entries.

                              RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                              S 1 Reply Last reply Reply Quote 0
                              • S
                                spud11 @mediamogul
                                last edited by spud11

                                @mediamogul Hi. Thanks for your patience.

                                If that means going into the Retroarch menu, going to user 5 (being the 1st of the 4-way joysticks) and mapping those keys to that joystick's buttons, I did that, but unfortunately it had no result either.

                                I've also tried the non-libretro advmame emulator. As an experiment, in the runcommand-onstart.sh, I switched from "mame-libretro" to "mame-advmame", mapped the joystick buttons using the TAB menu in game which did work, but once I exited the game and re-started it again, the joysticks were assigned new js numbers which weren't the same as before and so the controls were messed up.

                                I'm already using the joystick-selection tool which maps the 4 DragonRise xpad drivers to Players 1-4, so they don't change each time. The result is that I can't "fix" the xboxdrv joysticks to players 1 to 4.

                                Just trying to think of alternatives. What if, in the advmame TAB menu, I changed the keys to UP, DOWN etc to keyboard controls, then in the runcommand_onstart.sh, remapped the joystick buttons to the keyboard inputs?

                                RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                mediamogulM 1 Reply Last reply Reply Quote 0
                                • mediamogulM
                                  mediamogul Global Moderator @spud11
                                  last edited by

                                  @spud11 said in

                                  If that means going into the Retroarch menu, going to user 5 (being the 1st of the 4-way joysticks) and mapping those keys to that joystick's buttons

                                  That's the first part of it. Then you need to use xboxdrv to map those controllers to send out the corresponding keyboard keys when each button is pressed.

                                  What if, in the advmame TAB menu, I changed the keys to UP, DOWN etc to keyboard controls, then in the runcommand_onstart.sh, remapped the joystick buttons to the keyboard inputs?

                                  That's the same idea as the method above, but it would be limited to only working in Advance MAME.

                                  RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                  S 1 Reply Last reply Reply Quote 0
                                  • S
                                    spud11 @mediamogul
                                    last edited by

                                    @mediamogul Hi mediamogul.

                                    I'll try using Advmame rather than Retroarch to begin with, so will map advmame to the keys using the TAB menu.

                                    I'm not near my Pi at the moment, but I was just wondering if you could please look at the syntax to see if anything stands out as being obviously wrong please as I haven't used the ui settings in this way before:

                                    sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                    --silent \
                                    --detach-kernel-driver \
                                    --deadzone=4000 \
                                    --deadzone-trigger 15% \
                                    --force-feedback \
                                    --mimic-xpad \
                                    --trigger-as-button \
                                    --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                    --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.2:1.0-event-joystick \
                                    --device-name "Player_3_-_4-Way_Joystick_xboxdrv" \
                                    --evdev-absmap ABS_X=x1,ABS_Y=y1 \
                                    --four-way-restrictor \
                                    --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \
                                    --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \
                                    --ui-buttonmap a=KEY_A,b=KEY_B,x=KEY_X,y=KEY_Y,back=KEY_E,start=KEY_T \
                                    &
                                    

                                    The last 2 lines are the added lines. I'm assuming that I still need the --evdev-absmap line to map the axes, but that the --ui-axismap is sort of superimposed on top of it, so that the axes are mapped to the up, down, left, right keys on the keyboard.

                                    Thanks.

                                    RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                    mediamogulM 1 Reply Last reply Reply Quote 0
                                    • mediamogulM
                                      mediamogul Global Moderator @spud11
                                      last edited by

                                      @spud11

                                      if you could please look at the syntax to see if anything stands out as being obviously wrong

                                      Everything looks good.

                                      I'm assuming that I still need the --evdev-absmap line to map the axes, but that the --ui-axismap is sort of superimposed on top of it

                                      That's correct.

                                      RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                      S 1 Reply Last reply Reply Quote 0
                                      • H
                                        Hubz
                                        last edited by

                                        Is there any place where we're keeping mappings for systems and various controllers? I've got a Wii U Pro Controller I've been setting all mine up as and would be happy to share. I just spent a few hours figuring out mapping it for VICE which was a pain in the ass and I'd like to share to save someone else the trouble :P

                                        mediamogulM ExarKunIvE 2 Replies Last reply Reply Quote 0
                                        • mediamogulM
                                          mediamogul Global Moderator @Hubz
                                          last edited by

                                          @Hubz

                                          It's not a bad idea, but there are so many physical button variations in all the controllers out there and so many personal preferences as to how the end result should be that any collection would really only serve as a list of examples to start from. I've always encouraged people to post their finished examples here, but I'll be the first to admit that it's far from organized.

                                          RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                          1 Reply Last reply Reply Quote 0
                                          • ExarKunIvE
                                            ExarKunIv @Hubz
                                            last edited by

                                            @Hubz

                                            i second your thought.
                                            i have a 8bitdo NES30 pro

                                            and i would love you share my mappings too help people

                                            RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                                            RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                                            Maintainer of RetroPie-Extra .

                                            H 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.