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

    Assigning arcade buttons to virtual xbox controller

    Scheduled Pinned Locked Moved Help and Support
    xboxdrvcontrolsvirtualevtest
    4 Posts 2 Posters 625 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.
    • F
      fadangalini
      last edited by

      Raspberry Pi 4B with official power supply
      Retropie 4.7.1 downloaded from official site. (retropie-buster-4.7.1-rpi4_400.img.gz)
      500GB SD Card – (Image installed using ApplePi-Baker v2)
      2 x Ultrastik 360s (Analogue mapped)
      8 Way Powered USB Hub

      Hi,

      I'm struggling to assign my arcade controls to the virtual xbox controller using xboxdrv.

      For the most part it is fine and I have most buttons working ok.

      Unfortunately 2 of the buttons I wish to assign are not giving a name when using evtest, so I can't assign them.

      When I run evtest most of the buttons come back with the expected 'BTN_THUMB' etc. But these two buttons are coming back with (?). they have unique event codes, but no name I can use.

      I get the following for one of them to help you understand what i mean.:
      "type 1 (EV_KEY), code 302 (?), value 1"

      Is there any way I can use the code '302' instead of the name in xboxdrv?

      I've tried just putting 302 and "302" as below, but without success:
      --evdev-keymap BTN_TRIGGER=a,BTN_TOP2=b,"302"=x,

      If not, is there a way of assigning a name to that event that I can then use?

      Any help greatly appreciated, as If I can't get a workaround, It would mean some re-wiring of the controls..... last resort this far in! haha.

      Thanks

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @fadangalini
        last edited by

        @fadangalini said in Assigning arcade buttons to virtual xbox controller:

        "type 1 (EV_KEY), code 302 (?), value 1"

        This reports a keyboard button press, not a joystick button. Why don't you post the command line you use to start xboxdrv ?

        F 1 Reply Last reply Reply Quote 0
        • F
          fadangalini @mitu
          last edited by fadangalini

          @mitu
          Thanks for your reply. I'm using an UltraStik 360 with the buttons wired into the joystick. I'm trying to emulate a keyboard for Daphne. I think the joystick emulates key presses from the connected buttons.

          I have the code in runcommand-onstart.sh and what i have is working so far, I just need to sort those other two buttons. So far I have the directions, key 1 for 1 player, key 5 for coin and space for action all working from the joystick buttons.

          Here's the code i have so far:
          https://pastebin.com/embed_iframe/ges7BjsG

          Many thanks

          F 1 Reply Last reply Reply Quote 0
          • F
            fadangalini @fadangalini
            last edited by

            @fadangalini
            Fixed the problem.
            By putting KEY_#302 in place of where you would put BTN_THUMB for example, works.

            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.