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

    Here is a way to select joystick for players 1-4 (global or emu specific)

    Scheduled Pinned Locked Moved Help and Support
    retroarchinputcontrollerjoystickjoypad index
    154 Posts 28 Posters 149.4k 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.
    • edmaul69E
      edmaul69 @meleu
      last edited by edmaul69

      nm. ran it again and it worked

      meleuM 1 Reply Last reply Reply Quote 0
      • meleuM
        meleu @edmaul69
        last edited by meleu

        @edmaul69
        I glad you get it running, but let me take a few notes about your original post.

        1. I merged the selectionbyname branch into the master. In other other words, you don't have to use the -b selectionbyname option in the command line anymore, just
        git clone https://github.com/meleu/RetroPie-joystick-selection
        
        1. After install, there's no need to reboot the system. Only restart the emulationstation to see it in RetroPie menu.

        2. when using the selection by name method (and only in this condition) this tool uses the runcommand-onstart.sh to set some configs, but it does nothing in the actual runcommand menu (that one where you can choose the emulator, launch netplay, etc.). [oh. It made me think that would be really cool if there was an runcommand-onmenu.sh to be executed if the user select it from the runcommand menu. But I think it will not happen anytime soon.]

        3. the joystick-selection.cfg files are created on demand, and only when the selection by name method is active.

        Cheers!

        • Useful topics
        • joystick-selection tool
        • rpie-art tool
        • achievements I made
        edmaul69E 1 Reply Last reply Reply Quote 0
        • edmaul69E
          edmaul69 @meleu
          last edited by

          @meleu there wouldnt by some chance be a way that if the selected controller isnt detected that it would use the one detected is there? The ps 3 controller is the only reason i need this since it is always set as the last controller when wireless. When testing i had to turn on the ps3 controller to exit the game. Its fine if i have to just go into the joystick setup and change in advance. Just curious though. But thank you for this. Finally a way to use the ps3 controller on bluetooth. Both my pi 3's are built inside a console with their own controller ports wired up.

          meleuM 1 Reply Last reply Reply Quote 0
          • meleuM
            meleu @edmaul69
            last edited by

            @edmaul69 said in Here is a way to select joystick for players 1-4 (global or emu specific):

            if the selected controller isnt detected that it would use the one detected is there?

            Sorry, I'm not sure what you mean...

            When the selected controller isn't connected/detected, it uses the RetroArch defaults.

            (...) When testing i had to turn on the ps3 controller to exit the game.

            As far as I know the player1 is the only one that can use hotkeys (save state, reset the game, quit emulator, access RGUI, etc).

            I didn't understand what exactly you need/want.

            • Useful topics
            • joystick-selection tool
            • rpie-art tool
            • achievements I made
            edmaul69E 1 Reply Last reply Reply Quote 0
            • edmaul69E
              edmaul69 @meleu
              last edited by

              @meleu so for me it didnt use default retroarch setting. When i set the ps3 controller as the first controller it worked great. I rebooted with the ps3 controller turned off. Then i went into a game and the controls didnt work. I had to turn the ps3 controller on to do anything. I will test more thoroughly tomorrow

              meleuM 1 Reply Last reply Reply Quote 0
              • meleuM
                meleu @edmaul69
                last edited by meleu

                @edmaul69 said in Here is a way to select joystick for players 1-4 (global or emu specific):

                @meleu so for me it didnt use default retroarch setting

                Oh... If it's a bug, let's investigate it so I can fix it...

                (...) I rebooted with the ps3 controller turned off. Then i went into a game and the controls didnt work.

                Please, describe the complete scenario.

                When you rebooted with the ps3 controllers turned off, how many other controllers were connected to your raspi?

                • Useful topics
                • joystick-selection tool
                • rpie-art tool
                • achievements I made
                edmaul69E 1 Reply Last reply Reply Quote 0
                • edmaul69E
                  edmaul69 @meleu
                  last edited by

                  @meleu so i have 2 controllers on 1 circuit. Its called "ultimate pc interface" or upci. It is inside my modified intellivision flashback. So i install the joystick selector and immidiedly set the ps3 controller wirelessly as first joystick since unlike normal bluetooth devices it is always the last controller. (Controller 3 for me) So i go into an emulator and test that the ps3 controller and works and exits the emulator. So then i turn the system off and i turn it back on after the ps3 controller shuts off. So then i go into an emulator and i have no controls (maybe i only tried to exit but i thought i tried other controls) and nothing. So i turn on the ps3 controller and use it to exit. I will test some more when i wake up.

                  meleuM 1 Reply Last reply Reply Quote 0
                  • meleuM
                    meleu @edmaul69
                    last edited by

                    @edmaul69
                    Oh! I think I know what's happening!
                    You didn't turn on the selection by name method.

                    • Useful topics
                    • joystick-selection tool
                    • rpie-art tool
                    • achievements I made
                    edmaul69E 1 Reply Last reply Reply Quote 0
                    • edmaul69E
                      edmaul69 @meleu
                      last edited by

                      @meleu you sir are correct about that. I will try the name selection method and see how it goes.

                      meleuM 1 Reply Last reply Reply Quote 0
                      • meleuM
                        meleu @edmaul69
                        last edited by meleu

                        @edmaul69 when using by-index method it works like a manual editing of the file. The only advantage is that you can see the index to joystick correspondence during the configuration process. But once it is finished, it puts only the index in the retroarch.cfg.

                        • Useful topics
                        • joystick-selection tool
                        • rpie-art tool
                        • achievements I made
                        1 Reply Last reply Reply Quote 0
                        • meleuM
                          meleu @BuZz
                          last edited by

                          @BuZz said in Here is a way to select joystick for players 1-4 (global or emu specific):

                          I have implemented joypad selection into the configuration editor

                          It would be a nice feature if we could access that configedit "Choose a player to adjust" dialog for a specific system directly as a runcommand menu option, to let the user choose joypads right before launching a game.

                          I was thinking in something similar with -onstart script but I think that a runcommand menu option would be more concise and elegant. Then I was trying to find a way to invoke that configedit dialog directly for a specific system retroarch.cfg, but stumbled on the iniFileEditor complexity.

                          Is there a way to call that dialog directly?

                          • Useful topics
                          • joystick-selection tool
                          • rpie-art tool
                          • achievements I made
                          1 Reply Last reply Reply Quote 1
                          • meleuM
                            meleu @Rion
                            last edited by

                            @Rion said in Here is a way to select joystick for players 1-4 (global or emu specific):

                            Looking forward for Joystick support and included in run command before you start a game! :)

                            I didn't forget your request :)

                            BuZz answered my question above in other thread, and currently is not possible to make what I said.

                            But if you update your RetroArch from source you'll be able to change the controllers on-the-fly with RGUI with no issues (following the steps I detailed here). So there's no need to work on a runcommand option for it. ;-)

                            I think this RetroArch feature (all_users_control_menu) will be present in the next RetroPie release.

                            • Useful topics
                            • joystick-selection tool
                            • rpie-art tool
                            • achievements I made
                            RionR 1 Reply Last reply Reply Quote 1
                            • RionR
                              Rion @meleu
                              last edited by

                              @meleu said in Here is a way to select joystick for players 1-4 (global or emu specific):

                              @Rion said in Here is a way to select joystick for players 1-4 (global or emu specific):

                              Looking forward for Joystick support and included in run command before you start a game! :)

                              I didn't forget your request :)

                              BuZz answered my question above in other thread, and currently is not possible to make what I said.

                              But if you update your RetroArch from source you'll be able to change the controllers on-the-fly with RGUI with no issues (following the steps I detailed here). So there's no need to work on a runcommand option for it. ;-)

                              I think this RetroArch feature (all_users_control_menu) will be present in the next RetroPie release.

                              Yes i just saw this on Retropie Github.
                              retroarch - set all_users_control_menu to true by default

                              FBNeo rom filtering
                              Mame2003 Arcade Bezels
                              Fba Arcade Bezels
                              Fba NeoGeo Bezels

                              meleuM 1 Reply Last reply Reply Quote 1
                              • meleuM
                                meleu @Rion
                                last edited by

                                @Rion great! If it's in the retropie-setup scriptmodule, it seems that BuZz updated the binaries. :-)
                                It's a simple but usefull feature.

                                • Useful topics
                                • joystick-selection tool
                                • rpie-art tool
                                • achievements I made
                                1 Reply Last reply Reply Quote 0
                                • hansolo77H
                                  hansolo77
                                  last edited by

                                  So I'm now waist deep in my RetroPie setup. My plan, though I'm not there yet, is to have this all in an NES case. Currently I have an XBox 360 dongle. But I also have 2 NES controllers (which will use the original ports connected to an internal USB cable). In the future, I plan on adding 2 DB9 (Sega/Atari) plugs using USB as well. So my question is, would this script enable me to have control with the Xbox controller as the primary, then use the NES controllers as secondary for just NES, and then the Sega/etc for just those systems? In theory, allowing me to use either/or. Or is it going to be set as a permanant "You set it to use NES, so the XBOX no longer works till you return to ES".

                                  Who's Scruffy Looking?

                                  meleuM 1 Reply Last reply Reply Quote 0
                                  • meleuM
                                    meleu @hansolo77
                                    last edited by

                                    @hansolo77 said in Here is a way to select joystick for players 1-4 (global or emu specific):

                                    would this script enable me to have control with the Xbox controller as the primary, then use the NES controllers as secondary for just NES, and then the Sega/etc for just those systems?

                                    yes.

                                    In theory, allowing me to use either/or. Or is it going to be set as a permanant "You set it to use NES, so the XBOX no longer works till you return to ES".

                                    Sorry. I didn't understand this last part...

                                    You can set any controller to be the player1-4. The script don't care (actually don't know) about the details of your controller. If the Operational System detects a device as a joystick, the script will give you the option to set it for player1-4, globally or core specific.

                                    One thing to note is: if the controller you set to be, let's say, the player2 is not connected, then RetroArch will get the "second controller detected by the Operational System and set it to control the player2". The problem it's hard to be sure which controller is the second when you have a lot of them connected to the system (using any of these methods: USB, Bluetooth or GPIO).

                                    I hope this info can answer your questions.

                                    Cheers!

                                    • Useful topics
                                    • joystick-selection tool
                                    • rpie-art tool
                                    • achievements I made
                                    1 Reply Last reply Reply Quote 0
                                    • hansolo77H
                                      hansolo77
                                      last edited by

                                      Thanks. I guess what I'm really wanting to know is if I set an NES controller to be player 1 for NES, does that disable using the Xbox controller, or can I still use that as my controller too? It's easier for me to just use the Xbox controller, but I want to have the flexibility of using the original controllers when I want to.

                                      Who's Scruffy Looking?

                                      meleuM 1 Reply Last reply Reply Quote 0
                                      • meleuM
                                        meleu @hansolo77
                                        last edited by

                                        @hansolo77 It's not possible to set more than one controller to control the same player in RetroArch.

                                        But you can easily change the controller on-the-fly, using the way I shared here: https://retropie.org.uk/forum/topic/3882/change-retroarch-controllers-index-on-the-fly-with-no-issues

                                        • Useful topics
                                        • joystick-selection tool
                                        • rpie-art tool
                                        • achievements I made
                                        1 Reply Last reply Reply Quote 0
                                        • meleuM
                                          meleu
                                          last edited by

                                          Just a small improvement embellishment...

                                          A github user submitted a PR with the EmojiOne's joystick icon to use as an image for the joystick-selection tool in emulationstation. I liked it. :-)

                                          joystick

                                          Anyone who wants to see this icon, just update:

                                          git clone https://github.com/meleu/RetroPie-joystick-selection
                                          cd RetroPie-joystick-selection
                                          bash install.sh
                                          

                                          By the way, I'm planning to write a RetroPie script module for the tool to make it easier to update the scripts with no need to use keyboard or SSH, maybe it can be accepted. :-)

                                          • Useful topics
                                          • joystick-selection tool
                                          • rpie-art tool
                                          • achievements I made
                                          1 Reply Last reply Reply Quote 0
                                          • mercifulhackerM
                                            mercifulhacker
                                            last edited by

                                            @meleu Thank you so much for this! I tried recalbox on a lark, and I hated the lack of support and emulation, but I loved the GUI and ease of setup.

                                            This really helps me bridge the gap and make my retropie setup easier.

                                            Here's a little puzzle: How can I set a "preferred priority" with the controllers.

                                            E.g. I have GPIO buttons set as "GPIO Controller". Whenever I plug in a new controller I want the new controller to be Player 1, and the GPIO Controller to be player 2.

                                            When I plug in a 3rd controller, it bumps everything back so that GPIO is player 3, and so on.

                                            Any ideas on how I could accomplish this? Or would it just be simpler to assign the controllers as I plug them in?

                                            Thanks again!

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