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

    Setting up keys/keyboard wired to gpio

    Scheduled Pinned Locked Moved Help and Support
    configuring butons
    12 Posts 4 Posters 2.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.
    • S
      Shootersf
      last edited by

      Its a long time since I used it but I did this to make a dreamcast stick into a portable arcade and i'm not sure about any config script but I do know you need to write down the gpio number for each button and direction you have connected and then edit /boot/retrogame.cfg and match those numbers with whatever keyboard "key" you want them to act as. Then edit whatever emulators controller config you are using to use those "keys" for your inputs.

      I hope that makes some sense. What is it you are trying to do (in a larger sense)?

      1 Reply Last reply Reply Quote 0
      • K
        kevreh
        last edited by

        Yeah, that's basically what I'm doing. I'm able to get the joystick and keys A,B,X,Y, select, start to work. But not 1 player/2 player. When I "Configure Input" in the emulation station gui, it assumes I'm using a controller with extra buttons like shoulder and trigger. Isn't there a setting for a standard old school arcade setup with a joystick and buttons?

        Or maybe the bigger question is how do people configure their buttons, wired into the gpio, in retropie?

        edmaul69E 1 Reply Last reply Reply Quote 0
        • edmaul69E
          edmaul69 @kevreh
          last edited by edmaul69

          @kevreh if it is recognized as a keyboard you can only set up player 1 in emulationstation. In /opt/retropie/configs/all/retroarch.cfg you need to manually add the keyboard configs for both players. Note that retroarch no longer recognizes the f keys, the number keys and the num keys. So if your gpio pins use any of those you need to change them.

          1 Reply Last reply Reply Quote 0
          • K
            kevreh
            last edited by

            When you say " retroarch no longer recognizes the f keys, the number keys and the num keys.", does that mean I can't assign my 1 player button to the number 1? I've been told/read 1player is #1 key and 2player #2 key. Don't most games require a 1 player and 2 player button to start the game? Is there something better than connecting to the gpio pins directly?

            I only have a set of controls for 1 player (1 joystick for example). So that shouldn't be a problem. Is that what you meant?

            edmaul69E 1 Reply Last reply Reply Quote 0
            • edmaul69E
              edmaul69 @kevreh
              last edited by

              @kevreh retroarch doesnt use the number keys. Player 2 isnt pre set up. You need to go into the retroarch.cfg in /opt/retropie/configs/all/ . You have to have start buttons assigned to something else. By default player one uses return as start button (player 1 button). Shift is select (coin 1). Then a, b, x, and y are assigned to z, x,a and s on the keyboard. You can change all that. but you cannot use the buttons i described earlier.

              caver01C 1 Reply Last reply Reply Quote 0
              • caver01C
                caver01 @edmaul69
                last edited by

                @edmaul69 that's odd. I have been using numbers for player start and coin all along. It's via the ipac4 but definitely sending numbers as inputs for these.

                My 4-player cocktail style cabinet built as a custom "roadcase"

                edmaul69E 2 Replies Last reply Reply Quote 0
                • edmaul69E
                  edmaul69 @caver01
                  last edited by edmaul69

                  @caver01 are you using something under retropie 4.0? Before 4.0 retroarch let you fully use the keyboard. Plus if you played an emulator that uses a keyboard, it autimatically used the keyboard (computer emulators like msx uses a keyboard) when people were on 4.0 they complained that it stopped working. I was on 3.8.1 and as soon as I went to 4.0 it all stopped working. A couple weeks ago i added an ipac2 to my pi and i had to remove the player two settings from the numbers and num keys because they werent recognized. In retroarch maybe it lets you use it for coin and start. I assigned all the player 2 keys to numbers and they wouldnt work. I dont remember if i had tested start and select though

                  1 Reply Last reply Reply Quote 0
                  • edmaul69E
                    edmaul69 @caver01
                    last edited by

                    @caver01 i should also clarify, a gpio acts different than the keyboard in some ways. I have friends who have tried everything to make numbers work on gpio in retroarch but do on a keyboard. The number keys work on a keyboard but not on gpio or ipac from my personal experiences.

                    caver01C 1 Reply Last reply Reply Quote 0
                    • caver01C
                      caver01 @edmaul69
                      last edited by

                      @edmaul69 I can't speak from experience with so many retroarch emulators, but lr-mame2003 and lr-fbalpha are working for me using mame defaults. That would be sad (and ridiculous) if the standard MAME keys stopped working. PlayerStart 1-4 have always been 1-4 and Coin1-4 have always defaulted to numbers 5-8. I have not changed them.

                      My 4-player cocktail style cabinet built as a custom "roadcase"

                      edmaul69E 1 Reply Last reply Reply Quote 0
                      • edmaul69E
                        edmaul69 @caver01
                        last edited by

                        @caver01 ok so maybe for mame they work. The problem i found is not all retroarch emulators work with the number keys. I know the atari 7800 and genesis wouldnt work when i tested. So for a universal gpio controller i personally wouldnt use the number keys

                        1 Reply Last reply Reply Quote 0
                        • K
                          kevreh
                          last edited by

                          I was able to get the one player button working by assigning it to the # 1. Rp3 and latest retropie build as of 4/30.

                          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.