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 460.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.
    • ExarKunIvE
      ExarKunIv @mediamogul
      last edited by

      @mediamogul

      ok ill pull out the other configs and see that i get

      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 .

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

        ok i pulled everything out of my runcommand-onstart.sh

        and still got nothing. so i ran cat /proc/bus/input/devices
        and got this

        cat /proc/bus/input/devices
        I: Bus=0005 Vendor=3810 Product=0009 Version=0100
        N: Name="8Bitdo FC30 Pro"
        P: Phys=b8:27:eb:47:c7:78
        S: Sysfs=/devices/platform/soc/3f201000.uart/tty/ttyAMA0/hci0/hci0:11/0005:3810:0009.0003/input/input8
        U: Uniq=e4:17:d8:7a:6a:7d
        H: Handlers=js0 event0
        B: PROP=0
        B: EV=1b
        B: KEY=ffff0000 0 0 0 0 0 0 0 0 0
        B: ABS=30627
        B: MSC=10
        

        the event code is different. so i went in and changed it in my script

        if [ "$1" = "Videopac" ]
        then
        sudo killall > /dev/null 2>&1 xboxdrv
        sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
            --evdev /dev/input/event0 \
            --silent \
        	--detach-kernel-driver \
        	--force-feedback \
        	--mimic-xpad \
                --deadzone 15% \
        	--evdev-no-grab \
        	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \
        	--evdev-keymap KEY_#304=a,KEY_#305=b,KEY_#307=x,KEY_#308=y,KEY_#312=lt,KEY_#313=rt,KEY_#310=lb,KEY_#311=rb,KEY_#317=tl,KEY_#318=tr,KEY_#314=back,KEY_#315=start \
        	--axismap -Y1=Y1,-Y2=Y2 \
                --ui-buttonmap a=KEY_UNKNOWN,b=KEY_UNKNOWN,start=KEY_UNKNOWN,back=KEY_UNKNOWN,x=KEY_UNKNOWN,y=KEY_UNKNOWN,lt=KEY_UNKNOWN,rt=KEY_UNKNOWN,lb=KEY_UNKNOWN,rb=KEY_UNKNOWN,tl=KEY_UNKNOWN,tr=KEY_UNKNOWN \
        	--ui-axismap x2=KEY_1:KEY_2,Y2=KEY_3:KEY_4 \
        &
        fi
        

        sadly nothing, but i can test it my controller using evtest /dev/input/event0
        and i get reading, but nothing showing any mapping. :(
        so it still seems that the --evdev-no-grab \ is working too well

        edit
        i know why the event number changed so no big on there

        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 .

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

          update

          my mapping works, i move my right joystick and i get KEY_1, KEY_2 ect..and when i exit the evtest /dev/input/event1 goes away showing that it see that i have exited the same, and the --evdev-no-grab \ works as i can move with in the game just fine....as long as i have a usb keyboard to press 1 for me.

          for some reason it will not see my mapping as a valid key press

          now im confused.

          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 .

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

            @ExarKunIv

            for some reason it will not see my mapping as a valid key press

            Ah, OK. I think I know what's wrong. Take a look at the final part of section 3A of the guide if you haven't already. It tells how to set a udev rule so that RetroArch will see the xboxdrv vitualized keyboard as being a real keyboard.

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

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

              @mediamogul

              the funny thing is that i already had that, so when i looked at it again i saw my problem

              you have this on your guide

              SUBSYSTEM=="input", ATTRS{name}=="Microsoft X-Box 360 pad - Keyboard Emulation", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
              

              i had to change it to this

              SUBSYSTEM=="input", ATTRS{name}=="Microsoft X-Box 360 pad", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
              

              i know that i dont have a custom name but i remember what the cat /proc/bus/input/devicespulled up when i ran it whit the script going.

              so i think that did it, but i will have to do more testing tomorrow, but it is looking good now

              and as always thanks for the help

              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 .

              mediamogulM 1 Reply Last reply Reply Quote 2
              • mediamogulM
                mediamogul Global Moderator @ExarKunIv
                last edited by

                @ExarKunIv said in Guide: Advanced Controller Mappings:

                you have this on your guide... i had to change it to this

                I'll test that with a few controllers. It may need to be changed in the guide. Thanks for pointing it out.

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

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

                  well i have done testing on my end and my config works, and so do the others even with the change for the 99-xboxdrv.rules

                  here is my config for 8BitDo to work with videopac/Odyssey2

                  if [ "$1" = "videopac" ]
                  then
                  sudo killall > /dev/null 2>&1 xboxdrv
                  sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
                      --evdev /dev/input/event0 \
                      --silent \
                  	--detach-kernel-driver \
                  	--force-feedback \
                  	--mimic-xpad \
                          --deadzone 15% \
                  	--evdev-no-grab \
                  	--dpad-as-button \
                  	--trigger-as-button \
                  	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \
                  	--evdev-keymap KEY_#304=a,KEY_#305=b,KEY_#307=x,KEY_#308=y,KEY_#312=lt,KEY_#313=rt,KEY_#310=lb,KEY_#311=rb,KEY_#317=tl,KEY_#318=tr,KEY_#314=back,KEY_#315=start \
                  	--axismap -Y1=Y1,-Y2=Y2 \
                          --ui-buttonmap a=KEY_UNKNOWN,b=KEY_UNKNOWN,start=KEY_UNKNOWN,back=KEY_UNKNOWN,x=KEY_UNKNOWN,y=KEY_UNKNOWN,lt=KEY_UNKNOWN,rt=KEY_UNKNOWN,lb=KEY_UNKNOWN,rb=KEY_UNKNOWN,tl=KEY_UNKNOWN,tr=KEY_UNKNOWN \
                  	--ui-axismap x2=KEY_1:KEY_2,Y2=KEY_3:KEY_4 \
                  &
                  fi
                  

                  just remember to do part of section 3A of the guide as @mediamogul says

                  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 .

                  1 Reply Last reply Reply Quote 3
                  • ExarKunIvE
                    ExarKunIv @mediamogul
                    last edited by

                    @mediamogul

                    quick question
                    how do i use this for ports, i mean what do i put in the name

                    if [ "$1" = "videopac" ]
                    

                    example if i want to set a mapping for rise of the triad, do i use rott for that is the folder name, or does the word port need to be in there due to it being in the port folder?

                    hope this is clear

                    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 .

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

                      @ExarKunIv

                      $1 is the variable for the system/port name, so:

                      if [ "$1" = "rott" ]
                      

                      should do the job.

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

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

                        @mediamogul

                        sweet
                        thanks again

                        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 .

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

                          so have been playing round with getting ESC mapped for Solarus. so that way i can exit it easyly.
                          my mapping works great

                          if [ "$1" = "zelda_roth_se,zsdx,zsxd" ]
                          then
                          sudo killall > /dev/null 2>&1 xboxdrv
                          sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
                              --evdev /dev/input/event1 \
                              --silent \
                          	--detach-kernel-driver \
                          	--force-feedback \
                          	--mimic-xpad \
                                  --deadzone 15% \
                          	--evdev-no-grab \
                          	--dpad-as-button \
                          	--trigger-as-button \
                          	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \
                          	--evdev-keymap KEY_#304=a,KEY_#305=b,KEY_#307=x,KEY_#308=y,KEY_#312=lt,KEY_#313=rt,KEY_#310=lb,KEY_#311=rb,KEY_#317=tl,KEY_#318=tr,KEY_#314=back,KEY_#315=start \
                          	--axismap -Y1=Y1,-Y2=Y2 \
                              --ui-buttonmap a=KEY_UNKNOWN,b=KEY_UNKNOWN,start=KEY_UNKNOWN,back=KEY_UNKNOWN,x=KEY_UNKNOWN,y=KEY_UNKNOWN,lt=KEY_UNKNOWN,rt=KEY_UNKNOWN,lb=KEY_UNKNOWN,rb=KEY_UNKNOWN,tl=KEY_UNKNOWN,tr=KEY_ESC \
                          	--ui-axismap x2=void,Y2=void \
                          &
                          fi
                          

                          but only if i put it in manually. if will not auto start.

                          im sure that i have something wrong with the port name

                          if [ "$1" = "zelda_roth_se,zsdx,zsxd" ]
                          

                          i have tryed just useing Solarus but no go. any ideas?

                          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 .

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

                            @ExarKunIv

                            Try changing:

                            if [ "$1" = "zelda_roth_se,zsdx,zsxd" ]
                            

                            to:

                            if [ "$2" = "solarus" ]
                            

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

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

                              @mediamogul

                              thanks for getting back to me, but sadly nothing happens

                              i ran cat /proc/bus/input/devices and all it pulls up is my 8BitDo.

                              this is beginning to bug me

                              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 .

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

                                @ExarKunIv

                                It might be:

                                if [ "$1" = "solarus" ]
                                

                                instead

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

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

                                  @mediamogul

                                  tired that too, still nothing

                                  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 .

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

                                    @ExarKunIv

                                    Try putting the following at the top of your runcommand-onstart:

                                    ## Name of the emulator
                                    echo $1 >> /dev/shm/runcommand.log
                                    
                                    ## Name of the software used for running the emulation
                                    echo $2 >> /dev/shm/runcommand.log
                                    
                                    ## Name of the rom
                                    echo $3 >> /dev/shm/runcommand.log
                                    
                                    ##Executed command line
                                    echo $4 >> /dev/shm/runcommand.log
                                    

                                    Then, after you launch solarus, look at your /dev/shm/runcommand.log file and list what's on the first four lines.

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

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

                                      @mediamogul

                                      zelda_roth_se
                                      solarus
                                      
                                      LD_LIBRARY_PATH=/opt/retropie/ports/solarus/lib /opt/retropie/ports/solarus/bin/solarus_run /opt/retropie/ports/solarus/share/solarus/zelda_roth_se/
                                      /opt/retropie/configs/all/runcommand-onstart.sh: line 109: syntax error near unexpected token `&'
                                      /opt/retropie/configs/all/runcommand-onstart.sh: line 109: `&'
                                      Parameters: 
                                      Executing: LD_LIBRARY_PATH=/opt/retropie/ports/solarus/lib /opt/retropie/ports/solarus/bin/solarus_run /opt/retropie/ports/solarus/share/solarus/zelda_roth_se/
                                      Solarus 1.4.5
                                      Opening quest '/opt/retropie/ports/solarus/share/solarus/zelda_roth_se/'
                                      AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse"
                                      2D acceleration: yes
                                      

                                      ask and you will receive

                                      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 .

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

                                        @ExarKunIv

                                        Based on "solarus" being the second line,

                                        if [ "$2" = "solarus" ]
                                        

                                        should be doing the trick. After you launch solarus with that setting, check to see if xboxdrv is at least launching alongside it from another terminal.

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

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

                                          @mediamogul

                                          how do i check if xboxdrv is running.

                                          and should i worry about /opt/retropie/configs/all/runcommand-onstart.sh: line 109: syntax error near unexpected token &'
                                          /opt/retropie/configs/all/runcommand-onstart.sh: line 109: &'

                                          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 .

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

                                            @ExarKunIv

                                            how do i check if xboxdrv is running.

                                            You can run top via ssh.

                                            and should i worry about... line 109

                                            It might be the issue here. If nothing else, it's likely to be some other issue that needs looking at. Take a look at line 109 of the runcommand-onstart.sh closely to see if anything stands out.

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

                                            ExarKunIvE 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.