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 133.3k 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.
    • meleuM
      meleu
      last edited by meleu

      Well... I made a way to let the user choose which controller to use for RetroArch players 1-4.

      take a look at:
      https://github.com/meleu/RetroPie-joystick-selection

      OBS.: This is for RetroArch emulators only! It means the default RetroPie emulators for Atari 2600, NES, SNES, Master System, Mega Drive, Sega CD, 32X, and many others (those which starts with lr-)...

      Please, give me feedback to improve that. And if you know how to code, feel free to improve it yourself.

      Some infos from the README:


      The joystick selection has two methods of work:

      1. The traditional joystick selection by its index number;
      2. The new joystick selection by name method

      The advantage of the selection by name method is that there is no need to care about the joystick connection order. You can configure your "Generic USB SNES gamepad" to be the player1 no matter what USB port you use. Or, better yet, configure your "Fancy Bluetooth joypad" to be the player1 no matter what was the order it was paired or how many USB joysticks are connected.

      Installation

      [08-May-2020] The installation procedure has changed (again)!

      Some people were having issues with the previous installation procedure, then I changed it to simplify things.

      wget -O- "https://raw.githubusercontent.com/meleu/RetroPie-joystick-selection/master/install.sh" | sudo bash
      

      The script will automatically download the joystick-selection scriptmodule and install everything you need.

      After that you are ready to use it via RetroPie menu in emulationstation (maybe you'll need to restart emulationstation).

      Update

      After installing, you can update it through RetroPie-Setup.

      To update the joystick-selection tool, go to RetroPie-Setup and:

      Manage packages >> Manage experimental packages >> joystick-selection >> Update from source

      Screenshots

      Main menu:

      main-meu

      Global configuration (with no configs):

      config-all-unset

      Joystick selection screen:

      joy-select

      Global configuration (by index method, all 4 joysticks are set):

      config-all-index

      Global configuration (by name method, all 4 joysticks are set):

      config-all-configured

      Systems menu (I have just a few of them installed):

      system-menu

      • Useful topics
      • joystick-selection tool
      • rpie-art tool
      • achievements I made
      RionR 1 Reply Last reply Reply Quote 8
      • mediamogulM
        mediamogul Global Moderator
        last edited by

        Very cool! I'm going to make sure to give this a go.

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

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

          @meleu said in Here is a way to select input for RetroArch players 1-4:

          Well... I made a way to let the user choose what controller to use for RetroArch Players 1-4.

          take a look at:
          https://github.com/meleu/RetroPie-input-selection

          It's the first (and beta) version and currently needs to be handled via keyboard in the command line.

          Later I'll try to include it on RetroPie menu and add joystick handling capability.

          Please, give me feedback to improve that. And if you know how to code, feel free to improve it yourself.

          I think it would be really nice if this could be invoked through that dialog that appears just after the game selection, but I need to do some research on this topic...

          This should be included in thr retropie-setup-script. Looking forward for Joystick support and included in run command before you start a game! :)

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

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

            @Rion said in Here is a way to select input for RetroArch players 1-4:

            This should be included in thr retropie-setup-script. Looking forward for Joystick support and included in run command before you start a game! :)

            I think I need to study the retropie_setup coding style first. Maybe I need to polish my code as well...
            I'll try to do it later.

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

              I've just found the coding style guide for RetroPie shell scripts: https://github.com/RetroPie/RetroPie-Setup/wiki/Shell-Style-Guide

              I'll adapt my input_selection.sh as soon as possible.

              • Useful topics
              • joystick-selection tool
              • rpie-art tool
              • achievements I made
              mediamogulM 1 Reply Last reply Reply Quote 1
              • mediamogulM
                mediamogul Global Moderator @meleu
                last edited by

                @meleu

                I followed the directions from your GitHub. However, once input_selection.sh is executed and the script asks permission to enter a line into my runcommand.sh, I get the error; "jslist" not found!.

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

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

                  @mediamogul
                  I think you mean retroarch.cfg instead of runcommand.sh, right?

                  did you execute the install.sh? This script is supposed to execute the following tasks [EDIT: after the 2006-06-25 update, the install.sh is simpler than that]:

                  • create $HOME/bin directory.
                  • compile jslist.c and put the executable in $HOME/bin directory.
                  • put input_selection.sh in $HOME/bin directory.
                  • certifies that $HOME/bin is in your PATH.

                  If jslist is in $HOME/bin, and this directory is on your PATH, the "jslist" not found!problem shouldn't happen.

                  • Useful topics
                  • joystick-selection tool
                  • rpie-art tool
                  • achievements I made
                  mediamogulM 1 Reply Last reply Reply Quote 0
                  • mediamogulM
                    mediamogul Global Moderator @meleu
                    last edited by

                    @meleu said in Here is a way to select input for RetroArch players 1-4:

                    @mediamogul
                    I think you mean retroarch.cfg instead of runcommand.sh, right?

                    I did indeed.

                    If jslist is in $HOME/bin, and this directory is on your PATH, the "jslist" not found!problem shouldn't happen.

                    Gotchya. I'll try it again later this evening.

                    Thanks

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

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

                      I borrowed some code (from runcommand.sh) and added joystick support.
                      The input_selection.sh only needs some tweaks to work fine in RetroPie menu.

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

                        Great news! The script is ready to use in RetroPie menu!

                        Installation

                        It's pretty simple to install. Perform these commands on your RetroPie bash prompt:

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

                        After that you are ready to use it via RetroPie menu in emulationstation.

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

                          @meleu

                          Curious if this can be used with the kid-friendly version of ES?

                          RPI3, v 3.7 from SD Image, Last update, Bluetooth v1.0, Child-Friendly ES, 3 amp Power Supply, Case w/fan.

                          meleuM mattrixkM 2 Replies Last reply Reply Quote 2
                          • meleuM
                            meleu @opensourcefan
                            last edited by

                            @opensourcefan said in Here is a way to select input for RetroArch players 1-4:

                            @meleu

                            Curious if this can be used with the kid-friendly version of ES?

                            Oh, sorry. I have never used this ES version.

                            I know that the "Parse Gamelists Only" option must be off to let the input_selection be shown in RetroPie menu.

                            Please, try it and let me know if it works.

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

                              @meleu said in Here is a way to select input for RetroArch players 1-4:

                              @opensourcefan said in Here is a way to select input for RetroArch players 1-4:

                              @meleu

                              Curious if this can be used with the kid-friendly version of ES?

                              Oh, sorry. I have never used this ES version.

                              I know that the "Parse Gamelists Only" option must be off to let the input_selection be shown in RetroPie menu.

                              Please, try it and let me know if it works.

                              Is there anyway around this?

                              Also when launching a game and pressing the "a" button using the run command so I can choose what controller is P1 & P2 and so on for that particular game/system?

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

                              meleuM 2 Replies Last reply Reply Quote 0
                              • meleuM
                                meleu @Rion
                                last edited by meleu

                                @Rion said in Here is a way to select input for RetroArch players 1-4:

                                Is there anyway around this?

                                "This" what? The "Parse Gamelists Only" option?
                                Start button on emulationstation -> Other Settings -> Parse Gamelists Only. And turn it off (this is the default, so if you didn't change it, don't worry).

                                Also when launching a game and pressing the "a" button using the run command so I can choose what controller is P1 & P2 and so on for that particular game/system?

                                I think it requires some coding in runcommand.sh. I'm not feeling so confident to play with RetroPie official code for now... But I'll try it later. ;)

                                • 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 input for RetroArch players 1-4:

                                  @Rion said in Here is a way to select input for RetroArch players 1-4:

                                  Is there anyway around this?

                                  "This" what? The "Parse Gamelists Only" option?
                                  Start button on emulationstation -> Other Settings -> Parse Gamelists Only. And turn it off (this is the default, so if you didn't change it, don't worry).

                                  Also when launching a game and pressing the "a" button using the run command so I can choose what controller is P1 & P2 and so on for that particular game/system?

                                  I think it requires some coding in runcommand.sh. I'm not feeling so confident to play with RetroPie official code for now... But I'll try it later. ;)

                                  Looking forward to see what you can accomplish. Great work so far! :)

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

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

                                    Today another step was taken. I added a dialog to show the current config before start the configuration. So the user can decide to change the config or not.

                                    And after the configuration process, it'll show the changes that will be made. Again the user can decide to accept it or not.

                                    Please, update your scripts:

                                    git clone https://github.com/meleu/RetroPie-joystick-selection
                                    cd RetroPie-joystick-selection
                                    bash install.sh
                                    
                                    • Useful topics
                                    • joystick-selection tool
                                    • rpie-art tool
                                    • achievements I made
                                    1 Reply Last reply Reply Quote 2
                                    • meleuM
                                      meleu
                                      last edited by meleu

                                      I forgot to mention: in the dialog that shows the configs, there are alerts for Players with no joysticks.

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

                                        I posted an issue at RetroArch github talking about the problem of the current input configuration method using RGUI. If they implement some simple enhancements, my script will become unecessary (and I hope that! :D ).

                                        Please, take a look there and post some comments if you think it deserves.

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

                                          Today I've made some improvements:

                                          • rename the project/script to joystick selection (I think "joystick" is more specific than "input", and the script deals with joysticks only).
                                          • added an initial menu.
                                          • during the configuration, let the user decide if he/she wants to keep the current config for each player (usefull when the system has less then 4 joysticks available).
                                          • an option to restore the defaul settings (input_player1_joypad_index = 0, input_player2_joypad_index = 1, input_player3_joypad_index = 2, input_player4_joypad_index = 3)
                                          • the jslist is now placed in /opt/retropie/supplementary/. I choose this way cause if the user decides to uninstall RetroPie someday, the jslist will go together.
                                          • the joystick_selection.sh (former input_selection.sh) is now placed directly in $HOME/RetroPie/retropiemenu/ and is invoked via RetroPie menu only.
                                          • the install.shwill delete the old input_selection.sh scheme, if it exists (delete the jslist and input_selection.sh, in $HOME/bin; delete the $HOME/bin if it's empty; delete the input_selection.sh entry in RetroPie menu), and of course, install the current scheme.

                                          Please, update your scripts:

                                          git clone https://github.com/meleu/RetroPie-joystick-selection
                                          cd RetroPie-joystick-selection
                                          bash install.sh
                                          
                                          • Useful topics
                                          • joystick-selection tool
                                          • rpie-art tool
                                          • achievements I made
                                          1 Reply Last reply Reply Quote 2
                                          • meleuM
                                            meleu
                                            last edited by

                                            And now the install.sh creates a gamelist.xml entry for joystick_selection.sh. So there is no problem when the "PARSE GAMELISTS ONLY" is set to "ON".

                                            • Useful topics
                                            • joystick-selection tool
                                            • rpie-art tool
                                            • achievements I made
                                            RionR FurlugeF 2 Replies Last reply Reply Quote 1
                                            • 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.