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

    How can I control 2 players with one keyboard (RetroArch)?

    Scheduled Pinned Locked Moved Help and Support
    40 Posts 6 Posters 27.9k 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.
    • TheStrayMongrelT
      TheStrayMongrel
      last edited by TheStrayMongrel

      Hi peoples

      Just wondering if anyone out there can help. Im having troubles re-jigging the controls on fba and was wondering if anyone out there knows where im going wrong. Been using Street Fighter 2 Alpha as my testing game and the controls work okay but want to swap around the buttons.
      Have been editing the "/opt/retropie/emulators/pifba/fba2x.cfg" without any success unfortunately. I understand that the key SDL_keysym.h must be refered to when allocating buttons but seeing the button presses work okay and im just trying to juggle them a round i cant see why that wouldnt work. Any ideas?

      There also is the mater of "#player 2 keyboard controls, disabled by default", but i assume that if the controls list doesnt have a "999" next to it then they should be working?

      Any help would be much appreciated.

      Cheers

      Raspberry Pi 2 B+

      meleuM rbakerR 2 Replies Last reply Reply Quote 0
      • TheStrayMongrelT
        TheStrayMongrel
        last edited by

        I should have probably added that im using arcade joysticks and buttons mapped to keyboard strokes using the Adafruit utility.

        Thanks

        Raspberry Pi 2 B+

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

          @TheStrayMongrel are you sure that you are using piFBA (and not a libretro fba)?

          • Useful topics
          • joystick-selection tool
          • rpie-art tool
          • achievements I made
          1 Reply Last reply Reply Quote 0
          • rbakerR
            rbaker @TheStrayMongrel
            last edited by

            @TheStrayMongrel I have this issue. Never been able to solve it. I read somewhere that the controls were hardcoded and Player 2 disabled by default. I then found that the issue was resolved two years ago so I updated from source in the retropie menu. It made no difference. I have moved to lr-fba-next and it works fine however, I do find pifba faster so I'd love to get it working. I started a thread on it here.

            1 Reply Last reply Reply Quote 0
            • T
              Threepwood
              last edited by

              Did that last year with retropie 2.7 or something.

              I just translated the buttons to the numbers, so like you have done

              But it worked for me, using ipac2, even for player 2

              I know, not a help at all, but in the past I did nothing else like you have written

              1 Reply Last reply Reply Quote 0
              • TheStrayMongrelT
                TheStrayMongrel
                last edited by

                Ah @meleu I am actually using libretro fba, still having the same issues when i try to change: /opt/retropie/configs/fba/fba2x.cfg. I assume there are no other controller configs anywhere?

                Thinking that using the key strokes to run the joysticks might not be the best idea, given juggling hte controls around is one thing but not having 2 player working at all is another?

                Anybody know much about this bit, and a "how to" guide?
                [Joystick]
                "# Get codes from "jstest /dev/input/js0""
                "# from package "joystick""

                Thanks all.
                Will look around but

                Raspberry Pi 2 B+

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

                  @TheStrayMongrel the /opt/retropie/configs/fba/fba2x.cfg file is the config file for pifba only.

                  For libretro fba cores (core is how libretro calls its emulators) the file is /opt/retropie/configs/fba/retroarch.cfg, but there is a simpler way to remap the buttons. Recently I updated the "Core Input Remapping" section of the RetroArch Configuration page of the wiki with this info, take a look here:
                  https://github.com/retropie/retropie-setup/wiki/RetroArch-Configuration#core-input-remapping

                  Hope it helps.

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

                    Using lr-fba i have two seperate gamelists showing up on emulationstation. One for all 6 button fighters except the very first street fighter. The other for all other games including the first street fighter. So i configure the non six button games configuration to the first street fighter and the configurations work great. You can test gunsmoke and all 3 directional shooting buttons will in the correct order. All the 6 button games share the same button layout. You can also create seperate config files if you find a game that needs the controls tweaked. Those go in the roms folder. So for example the street fighter rom is called sf.zip. So in the roms folder you would have the config file named sf.zip.cfg. I only use lr-fba for all the capcom arcade games so your controls may vary but shouldnt really be a problem.

                    1 Reply Last reply Reply Quote 0
                    • TheStrayMongrelT
                      TheStrayMongrel
                      last edited by

                      Fantastic @meleu had no idea there was a fba config gui. Got it up and just changed the input format to "arcade" from "gamepad" and the buttons came good automatically. That said i still have nothing on player two. Given i'm using keyboard keystrokes to run both controls and everthing config wise seems to assume youre using 2 gamepads im not sure where that leaves me...

                      Hi @edmaul69 that sounds like an interesting set up. Ive got most games, like gunsmoke and early street fighter 2 games running well on mame4all. Was really only wanting to get fba running for the more recent Streetfighter 2 Alpha, Streetfighter 3 and a few others. Would be very interested in having a look at an example of the .cfg file you speak of, give me idea of whats what.

                      Im thinking i might do some further reading and a fresh install on a different card, then look into arcade controls (most of the retropie setup stuff seems to assume people are going to use game pads... just not the same for arcade games IMO).

                      Thanks for all the help BTW, champions.

                      Raspberry Pi 2 B+

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

                        @TheStrayMongrel said in FBA controls config issue:

                        Fantastic @meleu had no idea there was a fba config gui.

                        This works for any libretro core, not just fba! ;-)

                        Good you liked it!

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

                          So i only just got a chance to do a full-on update last night in the hope that I'd be able to get joystick 2 (and buttons) working on lr-fba-next... no luck unfortunately. I'm thinking that im only hope is to do a fresh install, use the adafruit keyboard/GPIO utility im familiar with and see if i can get it working again. Pretty bummed to have to do this as everything else seems to be working really well... anything else i could try @meleu and @rbaker prior to going down this route? Or anyone else of course.

                          Thanks :)

                          Raspberry Pi 2 B+

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

                            @TheStrayMongrel let's remember the problem: you have 2 controllers (or a device with enough buttons for 2 players) but for the system it is just one keyboard. Am I right?

                            Is it an IPAC2?

                            • Useful topics
                            • joystick-selection tool
                            • rpie-art tool
                            • achievements I made
                            TheStrayMongrelT 1 Reply Last reply Reply Quote 0
                            • rbakerR
                              rbaker @TheStrayMongrel
                              last edited by

                              @TheStrayMongrel I would have thought that since it's a libretro emulator, it will just work if your other libretro emulators are. What does your config file look like?

                              1 Reply Last reply Reply Quote 0
                              • TheStrayMongrelT
                                TheStrayMongrel @meleu
                                last edited by

                                @meleu Yeah thats right, 2 joysticks and 6 buttons for each player. No ipac, running directly to the GPIO with the Adafruit keyboard utility converting button presses (https://learn.adafruit.com/retro-gaming-with-raspberry-pi/buttons). They button presses are definitely registering as I've got it set up and working well in mame4all. I also have Neo Geo working okay with the 2 players.

                                Remember trying to config retroarch and coming up against "gamepad A, gamepad B" etc... but not being able to map specific keyboard strokes ah la mame4alls tab menu, which was a stumbling block (probably need to look further into this really).

                                @rbaker thinking about it i dont really have any of the other libretro emulators working as such (cant recall if Neo Geo is or not?), just mame4all.

                                So thinking of workarounds last night and Im guessing that the way to go is to ditch my control system for mame4all, and get retroarch working, then reconfigure mame4all as allocating buttons in that is really easy. But i guess a question is that within Retroarch the config of how to get "gamepad 2 button a, or gampad 1 button c" (sorry thats probably not the exact syntax, cant recall exactly) to match up with my my mapped keyboard presses.

                                Thanks for your help guys.

                                btw, went through the keyboard config when i first started up Retropie and all worked fine.

                                Raspberry Pi 2 B+

                                1 Reply Last reply Reply Quote 0
                                • TheStrayMongrelT
                                  TheStrayMongrel
                                  last edited by

                                  @rbaker Dont have my config file handy but its very similar to the one you posted in this thread.

                                  https://retropie.org.uk/forum/topic/1914/has-anyone-got-a-keyboard-working-for-player-2-in-pifba/2

                                  [Keyboard]
                                  #Get codes from /usr/include/SDL/SDL_keysym.h
                                  A_1=306
                                  B_1=32
                                  X_1=308
                                  Y_1=120
                                  L_1=122
                                  R_1=304
                                  START_1=49
                                  SELECT_1=53
                                  LEFT_1=276
                                  RIGHT_1=275
                                  UP_1=273
                                  DOWN_1=274
                                  QUIT=27
                                  #player 2 keyboard controls, disabled by default
                                  A_2=97
                                  B_2=115
                                  X_2=113
                                  Y_2=107
                                  L_2=105
                                  R_2=119
                                  START_2=114
                                  SELECT_2=102
                                  LEFT_2=100
                                  RIGHT_2=103
                                  UP_2=114
                                  DOWN_2=102

                                  Raspberry Pi 2 B+

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

                                    @TheStrayMongrel are you using pifba or the libretro fba?
                                    I thought you were using the libretro one.

                                    For pifba you need the to reinstall from source, as mentioned on the thread you linked.

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

                                      Sorry yeah i am using Libretro, the games i want to get going dont work on piFBA. Sorry getting myself a little tied in knots here, that config i just posted is for piFBA isnt it.
                                      edit: lr-fba-next to be exact.

                                      Raspberry Pi 2 B+

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

                                        @TheStrayMongrel the fba2x.cfg is for pifba only.

                                        @rbaker said that RetroArch already works with one keyboard for 2 players. I never tried it but I think it's perfectly doable (I'm away from my raspi now to make some tests).

                                        Is your problem with fba only? Can you play SNES games with 2 players, for example?

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

                                          Yeah @meleu thats right, @rbaker did say that, thats why i cant work out why its not working... and if i've done something screwy with the config.

                                          I did try Donkey Kong Country last night briefly and 2 player wasnt working on that... so guessing no. Not tested any further than that though as Mame is where i concentrate most of my time.

                                          Raspberry Pi 2 B+

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

                                            @TheStrayMongrel I asked that to suggest you to change the title of this thread.
                                            Maybe "how can I control 2 players with one keyboard (RetroArch)?" fits better.

                                            I'm at work now and can't help you at this very moment, sorry. But with a more descriptive title, maybe someone else can give a look here. It shouldn't be that much complicated.

                                            • Useful topics
                                            • joystick-selection tool
                                            • rpie-art tool
                                            • achievements I made
                                            TheStrayMongrelT 2 Replies 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.