RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Mapping a keyboard key to the gamepad(s)?

    Scheduled Pinned Locked Moved General Discussion and Gaming
    12 Posts 6 Posters 10.5k 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.
    • RK.aus.SR
      RK.aus.S
      last edited by

      Hello

      I'm quite new with RetroPie - but I love it! :-)

      Question:
      Currently I play all the VIDEOPAC games that remember me on my childhood. To start a game, I every time have to press "1" on the keyboard.
      Is there a way to somehow map the key "1" from the keyboard to a new shortcut on the two gamepads?
      This key mapping should only become effective when I use the VIDEOPAC bios and/or when I start any VIDEOPAC rom.

      I've read a lot about RetroArch - but I'm still unsure about how to manage this the right way.

      Kind regards,
      Roman

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

        Did you ever get an answer for this? Are you able to play UFO, and games that use the left handed keyboard configuration?
        Thanks.

        1 Reply Last reply Reply Quote 0
        • C
          Concat
          last edited by

          Check out LinuxJoystickMapper.

          I have it setup right now to map my controller to keyboard inputs when I launch the PPSSPP emulator.

          M 1 Reply Last reply Reply Quote 0
          • M
            msxer @Concat
            last edited by msxer

            @Concat said in Mapping a keyboard key to the gamepad(s)?:

            Check out LinuxJoystickMapper.

            I have it setup right now to map my controller to keyboard inputs when I launch the PPSSPP emulator.

            Did you set this up on a Raspberry Pi? How did you do it? Thanks!

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

              Hey @Concat were you asking about mapping a keyboard key in Videopac? or another emulator?

              C 1 Reply Last reply Reply Quote 0
              • C
                Concat @tigerinatlanta
                last edited by

                @tigerinatlanta

                Uhhh, I wasn't asking anything (?)

                Was just suggesting that if Retroarch doesn't have the appropriate options to map keyboards keys to a gamepad, that he could look at LinuxJoystickMapper.

                1 Reply Last reply Reply Quote 0
                • M
                  msxer
                  last edited by msxer

                  I have installed Linux Joystick Mapper (latest version 0.3.1) by following the steps in this post:
                  http://blog.petrockblock.com/forums/topic/mapping-a-game-controller-in-kodi/

                  I have also created a very simple mapping file to map the keyboard "1"-key to a button on my 8bitdo NES30 Pro controller:

                  button vendor=0x3820 product=0x0009 src=3 target=kbd button="1"
                  

                  After this, I can start the mapper binary just fine and get this output:

                  pi@retropie:~ $ sudo /home/pi/joymap/loadmap /home/pi/joymap/keyboard-8bitdo.map
                  0 joysticks.
                  Found device 8Bitdo NES30 Pro (vendor=0x3820, product=0x0009)
                  Found device JOYMAP Code Device (vendor=0x00ff, product=0x0000)
                  2 button assignments.
                  0 axes assignments.
                  

                  However, while the above is running, Emulation station and RetroArch do not respond to my 8bitdo controller at all. It seems that Linux Joystick Mapper "reserves" the original controller to create a virtual device "JOYMAP Code Device" and this JOYMAP Code Device itself is not known by RetroArch.

                  Did anyone get this working?

                  ExarKunIvE 1 Reply Last reply Reply Quote 0
                  • C
                    Concat
                    last edited by Concat

                    You're on the right track... but what you need to do is to run loadmap when the emulator is launched, and to kill the loadmap when the emulator exits.

                    You can do this in the emulators.cfg file. Have a look at this thread. dudleydes was the one who helped me get it running: https://retropie.org.uk/forum/topic/2032/dosbox-mapping-mouse-to-ps3-analog-stick/17

                    Since you have only mapped one button to the key "1", that's literally the only thing that EmulationStation and Retroarch can see - a keypress of 1. All other buttons are "blocked" for lack of a better term. So if you want to use the mapper, you have to map everything you need to control the emulator - not just one button mapping.

                    And if you map to joypad buttons, I think it takes another js slot, not the original js slot that the controller uses. The developer explained that his scripts prevents programs from seeing the input from the original js slot until the loadmap is killed. Something like that anyway. Check out the wiki on the sourceforge page to see the discussions.

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

                      @msxer

                      have you been able to get it to work.

                      i have been messing with it, and i just seem to get it to launch with the mapper.

                      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 M 2 Replies Last reply Reply Quote 0
                      • mediamogulM
                        mediamogul Global Moderator @ExarKunIv
                        last edited by mediamogul

                        @ExarKunIv

                        You can also use this alternative method as well:
                        https://github.com/retropie/retropie-setup/wiki/Universal-Controller-Calibration-&-Mapping-Using-xboxdrv

                        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

                          i know, i just like being able to reconnect my controller if i have to shut it down.
                          but im thinking that might be the only way i can get the key mapped :(

                          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
                          • M
                            msxer @ExarKunIv
                            last edited by

                            @ExarKunIv said in Mapping a keyboard key to the gamepad(s)?:

                            @msxer

                            have you been able to get it to work.

                            i have been messing with it, and i just seem to get it to launch with the mapper.

                            No, I gave up pretty quickly after unsuccesfully messing with Linux Joystick Mapper.

                            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.