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

    DosBox; Mapping mouse to PS3 Analog Stick

    Scheduled Pinned Locked Moved Help and Support
    32 Posts 6 Posters 22.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.
    • C
      Concat
      last edited by

      Hello all,

      Does anyone know how to do this? I've seen people do this for Kodi using this: http://sourceforge.net/projects/linuxjoymap/

      But unfortunately I'm not smart enough to understand how it to implement it for dosbox. Does dosbox not have this functionality built-in?

      D 1 Reply Last reply Reply Quote 0
      • mediamogulM
        mediamogul Global Moderator
        last edited by mediamogul

        Hah! I just got around to doing this earlier today for all the emulators that make use of a mouse. I'm using xboxdrv to accomplish it and the process can be a bit involved, but I'm working on automating it somewhat for general use. I haven't looked at doing it for the PS3 controller specifically, but if it has a standard event entry, it should work.

        Edit: I should have also added that if you're interested, we'll try to get it going.

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

        1 Reply Last reply Reply Quote 1
        • D
          dudleydes @Concat
          last edited by

          @Concat I'm using the Linux Joystick Mapper to map the mouse in DOS games to the PS3 left analog stick.

          To build loadmap, please follow the tutorial in this post at the old forum.

          Here is a generic mapping file, mouse.map that I'm using in mouse-driven DOS games. The left stick is used for moving the mouse cursor with the X button to left click and the square button as right click. The arrows keys are mapped to the D-pad. Escape is mapped to Select, Enter to Start and Space to the triangle button.

          To launch Albion, for example, I am using the following script.

          #!/bin/bash
          sudo /home/pi/joymap/loadmap /home/pi/RetroPie/roms/pc/dosbox-map/mouse.map &
          /opt/retropie/emulators/dosbox/bin/dosbox -c "mount c /home/pi/RetroPie/roms/pc" -c "c:" -c "cd ALBION" -c "LAUNCH.EXE" -c "exit" 
          sudo killall loadmap
          sleep 1
          

          Please note the locations of my mapping file and the loadmap program and adjust yours accordingly.

          I appreciate the Linux Joystick Mapper isn't the easiest to use but I have found it to be the best mapping program that works from the console.

          If there's a particular game you'd like to map then let me know. I'd be happy to test it and share a mapping file.

          1 Reply Last reply Reply Quote 2
          • M
            Mayki
            last edited by

            Please mapping Alien Breed game for PS3 gamepad.

            D 1 Reply Last reply Reply Quote 0
            • D
              dudleydes @Mayki
              last edited by

              @Mayki Alien Breed uses the cursor keys so you can use the DOSBox mapper. There is more information on how to do this at the wiki.

              https://github.com/retropie/retropie-setup/wiki/PC#tutorials

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

                @dudleydes
                Due to some issues with PPSSPP standalone, I'm now looking to utilize Linux Joystick mapper for the controls.

                Where is the shell script that launches PPSSPP? I am assuming I could add the lines to load the .map file in there, but I am a total noob at this...

                @meleu
                I'm including you because there's no pm on this forum and I know you would be able to tell me :)

                D 1 Reply Last reply Reply Quote 0
                • D
                  dudleydes @Concat
                  last edited by

                  @Concat The command to launch PPSSPP is in /opt/retropie/configs/psp/emulators.cfg.

                  I would try adding the following line to the file (assuming you are using the standalone version, not the libretro version):

                  ppsspp-loadmap="sudo /home/pi/joymap/loadmap /path/to/psp.map & /opt/retropie/emulators/ppsspp/PPSSPPSDL %ROM%; sudo killall loadmap; sleep 1"
                  

                  Now launch your psp rom as usual, press button 0 on your controller and select ppsspp-loadmap as your emulator from the runcommand menu. Alternatively, add or change the following line in emulators.cfg:

                  default="ppsspp-loadmap"
                  

                  I've not tested this so it may not work first time. If it doesn't, then let me know and I'll try to help you troubleshoot it.

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

                    @dudleydes
                    You rock. Thank you. I will give this a try!

                    One thing I don't know is if ppsspp will register the gamepad input and the keyboard input. Like say I map X on the ds3 to key z... will it register both the x on the gamepad AND z from keyboard? Since the control mapping is hardcoded... I suspect I might be hooped.

                    This might be a failure... but we shall see.

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

                      @dudleydes
                      It works!!!! Haha, you have no idea how stoked I am. I literally ran from my pi to my pc to type this :) I'm not getting any double inputs registering, I can navigate in the ppsspp menu AND I can control the game. Your instructions and code were spot on.

                      I have spent HOURS googling this issue and trying everything... the Linux Joystick Mapper was my last kick at it.

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

                        @dudleydes
                        I may have spoke too soon... PPSSPP uses key commands for the analog, so I tried mapping the axes to those keys:

                        axis vendor=0x054c product=0x0268 src=0 target=kbd plus="k" minus="i"
                        axis vendor=0x054c product=0x0268 src=1 target=kbd plus="l" minus="j"
                        

                        But it doesn't work well. I found this suggestion on the Linux Joystick Mapper wiki. It seems the lack of a deadzone built into the mapper causes havoc. It just keeps scrolling up in the menu no matter where the analog stick is pointed.

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

                          Please advice, it fails to map the mouse to left analog PS3 gamepad, mouse cursor is still in the upper left corner. The mouse buttons work well.

                          # Map Mouse
                          axis vendor=0x054c product=0x0268 src=0 target=mouse axis=0
                          axis vendor=0x054c product=0x0268 src=1 target=mouse axis=1
                          button vendor=0x054c product=0x0268 src=14 target=mouse button=0
                          button vendor=0x054c product=0x0268 src=15 target=mouse button=1
                          
                          C 1 Reply Last reply Reply Quote 0
                          • C
                            Concat @Mayki
                            last edited by

                            @Mayki
                            Are you mapping the mouse for dosbox, or PPSSPP? During my own troubleshooting, I tested for PPSSPP and the mouse didn't work either.

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

                              Mapping mouse for DosBox. Tested in the game Albion, Abuse and directly in DOSBox, the mouse cursor will automatically move into the upper left corner and not move him.

                              D C 2 Replies Last reply Reply Quote 0
                              • C
                                Concat
                                last edited by

                                @Mayki
                                That might be due to a poor deadzone on the analog stick. I think this is my issue as well. I know you can write additional scripts in the mapper, and the developer made reference to creating one for a deadzone of sorts on his wiki. I'm not sure I know how to do it properly... was hoping @dudleydes would help troublehsoot :)

                                1 Reply Last reply Reply Quote 0
                                • D
                                  dudleydes @Mayki
                                  last edited by

                                  @Mayki To use the mouse, DOSBox needs to capture it. This can be done by pressing CTRL+F10 or left-clicking, which, if using the mapping above, you can do by pressing X on your PS3 controller.

                                  @Concat I've not had any luck mapping keys to the analogue stick. All I would suggest is leave a message for the developer at the sourceforge page, which you have already done.

                                  C 1 Reply Last reply Reply Quote 1
                                  • M
                                    Mayki
                                    last edited by

                                    Not problem with capture, problem is analog axis. The left analog stick in the middle : constantly sends the cursor to the upper left corner, analog stick in the right down position : the cursor stops at the zero position.

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

                                      @dudleydes
                                      Just thought I'd ask what version of joymap you are using...

                                      D 1 Reply Last reply Reply Quote 0
                                      • D
                                        dudleydes @Concat
                                        last edited by

                                        @Concat I'm using version 0.3.1.

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

                                          @dudleydes

                                          Hmmm... well I'm at a loss. I can't get the mouse to map properly in Dosbox either. Cursor just sits in the top left corner like Mayki.

                                          Do you launch Albion from the command line? I suppose I could try that. Right now I have it set up to load the map in the .emulators.cfg file, much the same way you suggested I do it for PPSSPP. Perhaps there is some confliction with emulationstation(?)

                                          D 1 Reply Last reply Reply Quote 0
                                          • D
                                            dudleydes @Concat
                                            last edited by

                                            @Concat The script that I use to launch Albion is in my first post above. As you can see, I launch loadmap with each game to allow for game-specific mappings.

                                            Maybe you can try my binary. You can download it from here.

                                            1 Reply 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.