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

    PS4 Dual Shock Button Numbers

    Scheduled Pinned Locked Moved Help and Support
    ps4 controllers
    5 Posts 2 Posters 3.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.
    • K
      kbocek
      last edited by kbocek

      The button mapping done through the GUI process is stored at:

      /opt/retropie/configs/all/retroarch/autoconfig

      Right?

      Where can I find the button numbers to be mapped? Is this correct?

      https://ritchielozada.com/2016/11/21/playstation-4-dual-shock-controller-input-mapping-with-unity-on-windows-10/

      or is it:

      https://retropie.org.uk/forum/topic/17400/changed-button-numbers-on-ps3-controller-on-stretch-4-4-image

      Then I see things like "h0right" in autoconfig. What are those?

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

        I figured how how to get the numbers: use jstest

        If you pair the controller via bluetooth, you get a /dev/hidraw0 device. Jstest does not work with the hidraw device. But if you physically plug in the controller via USB, you get the /dev/input/js0 device. This does work with jstest.

        Interesting, the finger triggers are both an axis and a button. As you pull the trigger, axis 2 and 5 register the movement. As you start the pull, buttons 6 and 7 go to on.

        The numbers in the second post above are correct for Debian Stretch. With the exception of the Dpad numbers. They are axis 6 and 7 and do not have button values.

        1 Reply Last reply Reply Quote 1
        • K
          kbocek
          last edited by

          Correction. Bluetooth pairing creates both devices. Jstest just works only with the /dev/input one.

          1 Reply Last reply Reply Quote 0
          • ClydeC
            Clyde
            last edited by

            Thanks for sharing your solution.

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

              But there's more. I guess the /dev/hidraw0 device is something to with motion sensors. This appears to confuse emulationstation.

              https://retropie.org.uk/forum/topic/17650/dualshock-controllers-on-4-4-with-3b

              This has a udev rule to add that removes that second device. Fixed at least one game for me.

              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.