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

    Daphne Joystick Mapping Problem

    Scheduled Pinned Locked Moved Help and Support
    daphnedapinput.inidaphne joystick
    22 Posts 3 Posters 9.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.
    • mediamogulM
      mediamogul Global Moderator @dunnieboy
      last edited by mediamogul

      @dunnieboy said in Daphne Joystick Mapping Problem:

      where did you put this code ?

      I just wrapped it in the same type of if/else statement seen in other xboxdrv examples in the runcommand-onstart.sh so that it launches alongside the emulator.

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

      D 1 Reply Last reply Reply Quote 0
      • D
        dunnieboy @mediamogul
        last edited by dunnieboy

        @mediamogul said in Daphne Joystick Mapping Problem:

        @dunnieboy said in Daphne Joystick Mapping Problem:

        where did you put this code ?

        I just wrapped it in the same type of if/else statement seen in other xboxdrv examples in the runcommand-onstart.sh so that it launches alongside the emulator.

        crap ... i've been procrastinating on getting to that ... i'm not a code maven ...

        one line that i don't understand is the axismap -y1=y1 etc

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

          @dunnieboy

          crap ... i've been procrastinating on getting to that ... i'm not a code maven ...

          Just like almost anything, you might stumble along the way, but after a bit of experimentation and a few successes you'll find it's more routine than anything.

          one line that i don't understand is the axis y=-y etc

          It reverses the y-axis. Early on, I found out that this seems to be an issue for some reason when mapping most controllers. I'd almost forgotten it 's there, but it always seems to be necessary. If it was ever the case that up and down needed to be switched, you'd just remove the line completely.

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

          D 1 Reply Last reply Reply Quote 0
          • D
            dunnieboy @mediamogul
            last edited by

            @mediamogul with this scripting language ... are inline comments possible ... I mean ... can I do something like :

            #map the axis
            	--ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN,X2=KEY_LEFTSHIFT:KEY_Z,Y2=KEY_X:KEY_UNKNOWN \
            
            #map the buttons
            	--ui-buttonmap b=KEY_LEFTCTRL,a=KEY_LEFTALT,y=KEY_UNKNOWN,x=KEY_SPACE,lb=KEY_9,rb=KEY_F2,du=KEY_UP,dd=KEY_DOWN,dl=KEY_LEFT,dr=KEY_RIGHT,start=KEY_1,back=KEY_5,lt=KEY_UNKNOWN,rt=KEY_UNKNOWN,tl=KEY_UNKNOWN,tr=KEY_UNKNOWN \
            #map the keys
            	--ui-buttonmap back+start=KEY_ESC,back+b=KEY_F3,back+y=KEY_F12,back+a=KEY_F2,back+x=KEY_9 \
            #map more buttons to keystrokes
            	--ui-buttonmap lt+a=KEY_A,lt+b=KEY_B,lt+x=KEY_X,lt+y=KEY_Y,lt+lb=KEY_L,lt+rb=KEY_R,lt+du=KEY_UP,lt+dd=KEY_DOWN,lt+dl=KEY_LEFT,lt+dr=KEY_RIGHT,lt+start=KEY_T,lt+back=KEY_E \
            	--ui-buttonmap guide=void
            

            I wasn't sure because its all one command.

            Thanks

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

              @dunnieboy

              I don't think it should be a problem

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

              D 1 Reply Last reply Reply Quote 0
              • D
                dunnieboy @mediamogul
                last edited by

                @mediamogul any chance you could share your dapinput.ini ? I have altered mine and committed the crime of not creating a backup ;-).

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

                  @dunnieboy

                  Sure...

                  # Daphne cutom keyboard and joystick mapping
                  #
                  # Each input is mapped to 2 keyboard keys and one joystick button.
                  # A joystick's first analog stick is also automatically mapped.
                  #
                  # The first two numbers are SDL keyboard codes (or 0 for "none")
                  # Find keyboard codes here:
                  # http://www.daphne-emu.com/mediawiki/index.php/KeyList
                  #
                  # The third number is the joystick button code (or 0 for "none")
                  # Since 0 is reserved for special meaning, joystick button 0 is identified
                  # as 1 here.  Button 1 is identified as 2, and so on.
                  # 
                  # Find the button you want to map by running:
                  # jstest /dev/input/js0
                  
                  [KEYBOARD]
                  KEY_UP = 273 114 5
                  KEY_DOWN = 274 102 7
                  KEY_LEFT = 276 100 8
                  KEY_RIGHT = 275 103 6
                  KEY_BUTTON1 = 306 97 14
                  KEY_BUTTON2 = 308 115 15
                  KEY_BUTTON3 = 32 113 16
                  KEY_START1 = 49 0 4
                  KEY_START2 = 50 0 0
                  KEY_COIN1 = 53 0 1
                  KEY_COIN2 = 54 0 0
                  KEY_SKILL1 = 304 119 0
                  KEY_SKILL2 = 122 105 0
                  KEY_SKILL3 = 120 107 0
                  KEY_SERVICE = 57 0 0
                  KEY_TEST = 283 0 0
                  KEY_RESET = 284 0 0
                  KEY_SCREENSHOT = 293 0 0
                  KEY_QUIT = 27 113 17
                  END
                  
                  

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

                  D 1 Reply Last reply Reply Quote 0
                  • D
                    dunnieboy @mediamogul
                    last edited by dunnieboy

                    @mediamogul thanks ! - I noticed after using the xboxdrv and running the following from an ssh putty session while i launched dragons lair on the pie :

                    cat /proc/bus/input/devices
                    
                    I: Bus=0000 Vendor=0000 Product=0000 Version=0000
                    N: Name="donotroller (xboxdrv)"
                    P: Phys=
                    S: Sysfs=/devices/virtual/input/input3
                    U: Uniq=
                    H: Handlers=js1 event3
                    B: PROP=0
                    B: EV=20000b
                    B: KEY=10010000 0 0 0 0 0 0 0 0 0
                    B: ABS=3
                    B: FF=1 3f870000 0 0
                    

                    my new virtual xboxdrv joystick is being mapped to js1 event3.
                    my new virtual keyboard is being mapped to kbd event2
                    my original wireless controller is still being mapped to js0.
                    my original wireless keyboard is being mapped to kbd leds mouse0 event0

                    I thought i read somewhere .. and its all muddy right now ... that daphne needs the joystick to be js0. What are you thoughts ?

                    Thanks

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

                      @dunnieboy

                      I thought i read somewhere .. and its all muddy right now ... that daphne needs the joystick to be js0

                      Daphne can only make use of the first joystick event and it is completely inflexible in that regard. It's actually the reason I sought out an external mapping solution for RetroPie to begin with. However, one area where Daphne is entirely flexible is keyboard controls. As long as you key-map your joystick to match whatever the keyboard controls are in Daphne, it'll always work. You can even reverse up and down if you don't happen to like the helicopter controls in some of the flying shooters.

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

                      D 1 Reply Last reply Reply Quote 0
                      • D
                        dunnieboy @pixelpiklz
                        last edited by dunnieboy

                        @pixelpiklz this actually helped me out. Still have a couple weird
                        things going on.

                        1. Insert Coin I have mapped to my 'share' button on my controller ... it is requiring a double click.
                        2. The sword button is working now , but it too seems to want a double click.
                        3. When I do not insert a coin ... the game used to go into a video loop which was kind of cool ... it now goes to the insert coin screen and stays there.
                          (SOLVED : Evidently if there are coins inserted it wont loop - you will just see the screen below).

                        0_1489866460387_unnamed.jpg

                        Any thoughts on this ?

                        Here is my dapinput :

                        [KEYBOARD]
                        KEY_UP = 273 114 1
                        KEY_DOWN = 274 102 1
                        KEY_LEFT = 276 100 1
                        KEY_RIGHT = 275 103 1
                        KEY_BUTTON1 = 306 97 3
                        KEY_BUTTON2 = 308 115 2
                        KEY_BUTTON3 = 32 113 4
                        KEY_START1 = 49 0 5
                        KEY_START2 = 50 0 6
                        KEY_COIN1 = 53 0 9
                        KEY_COIN2 = 54 0 10
                        KEY_SKILL1 = 304 119 0
                        KEY_SKILL2 = 122 105 0
                        KEY_SKILL3 = 120 107 0
                        KEY_SERVICE = 57 0 0
                        KEY_TEST = 283 0 0
                        KEY_RESET = 284 0 0
                        KEY_SCREENSHOT = 293 0 0
                        KEY_QUIT = 27 113 13
                        END
                        
                        1 Reply Last reply Reply Quote 0
                        • D
                          dunnieboy @mediamogul
                          last edited by

                          @mediamogul That makes sense ... but how come my xboxdrv controller is not mapping to js0 ?

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

                            @dunnieboy

                            js0 is being occupied by your physical controller. The virtual controller created by xboxdrv will therefore always be at a higher assignment.

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

                            D 1 Reply Last reply Reply Quote 0
                            • D
                              dunnieboy @mediamogul
                              last edited by

                              @mediamogul said in Daphne Joystick Mapping Problem:

                              @dunnieboy

                              js0 is being occupied by your physical controller. The virtual controller created by xboxdrv will therefore always be at a higher assignment.

                              so now im really confused ... does your xboxdrv work for you ? How can it if your actual controller is using js0 ?

                              Sorry if this is obvious.

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

                                @dunnieboy

                                The event and js assignment of the physical controller are both deactivated after xboxdrv maps a new virtual controller. That virtual controller has it's own event and js assignment that can then be used in the emulators and ports. The reason that the physical controller assignments are deactivated is so that the system doesn't get input from two controllers (the physical and the virtual) when the one physical button is pressed.

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

                                D 1 Reply Last reply Reply Quote 0
                                • D
                                  dunnieboy @mediamogul
                                  last edited by

                                  @mediamogul right ... so how did you get your daphne xboxdrv controller to show as js0 ??

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

                                    @dunnieboy

                                    You don't have to. Once you map keyboard keys to your controller, Daphne will just think it's coming from a keyboard.

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

                                    D 1 Reply Last reply Reply Quote 0
                                    • D
                                      dunnieboy @mediamogul
                                      last edited by

                                      @mediamogul ahhhhhhh now that makes sense !

                                      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.