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

    Guide: Advanced Controller Mappings

    Scheduled Pinned Locked Moved Help and Support
    joystickcontrollermappingxboxdrvscummvm
    626 Posts 35 Posters 460.9k 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

      the dpad spits out nothing at all when I run evtest

      I've never come across that. If it's not seen by evtest at all, then there might be no way to map it in xboxdrv. I revised your example above to include a common entry for ABS_HAT0X and ABS_HAT0Y that might do the job. I also removed the last line, as it doesn't need to be there.

      #!/bin/bash
      sudo killall >/dev/null xboxdrv
      sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
      	--evdev /dev/input/event3 \
      	--detach-kernel-driver \
      	--deadzone-trigger 15% \
      	--deadzone 4000 \
      	--device-name "donotroller" \
      	--calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767 \
      	--trigger-as-button \
      	--dpad-as-button \
      	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y,ABS_RX=lt,ABS_RY=rt \
      	--evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_START=tl,BTN_SELECT=tr,BTN_THUMBL=guide,BTN_TL2=back,BTN_TR2=start \
      	--axismap -Y1=Y1,-Y2=Y2 \
      	--ui-axismap x1=KEY_LEFT:KEY_RIGHT,y1=KEY_UP:KEY_DOWN,x2=KEY_INSERT:KEY_DELETE,y2=KEY_EQUAL:KEY_MINUS \
      	--ui-buttonmap tl=KEY_RIGHTSHIFT,dd=KEY_M,du=KEY_G,dl=KEY_F,dr=KEY_B,lt=KEY_ENTER,rt=KEY_SPACE,a=KEY_L,b=KEY_E,x=KEY_X,y=KEY_Y,lb=KEY_T,rb=KEY_R,start=KEY_A,back=KEY_GRAVE \
      	&
      

      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 .. ill give that a try. One question about ,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y.

        I dont see dpad_x or dpad_y in the ui-buttonmap or ui-axismap. I thought (probably incorrectly) that the evdev lines were like definitions and the ui- lines were assignments. Is this the wrong way to think about this ?

        Thanks

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

          @dunnieboy

          I dont see dpad_x or dpad_y in the ui-buttonmap or ui-axismap.

          dpad_x and dpad_y are normally mapped in --ui-axismap. If the DPad of the original controller is digital, or --dpad-as-button is added, then they are mapped with du, dd, dl and dr in --ui-buttonmap.

          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 for all the advice ... just so you know im not crazy ... im trying to configure this ... =) Its SO helpful having someone like you willing to give advice.

            
            # DEFINITIONS -----------------------------------------------------------| XBOXDRV ASSIGNMENTS -----------------
            #                                                                        |
            # F L I G H T                                                            |
            #                                                                        | 
            # 01. Pitch and Yaw                : arrow U, arrow D, arrow L, arrow R  | (See Mouse Ctrl) 
            # 02. Pitch and Yaw Left           : Numpad 7,1                          | (See Mouse Ctrl)
            # 03. Pitch and Yaw Right          : Numpad 9,3                          | (See Mouse Ctrl)
            # 04. Roll Left, right             : Ins, Del                            | (See Mouse Ctrl)
            # 05. Double Yaw, Pitch, Roll Rates: Shift + Key                         | (See Mouse Ctrl)
            # 06. Engage Autoslide             : Caps Lock(Hold)                     | 
            # 07. Autoslide Toggle             : /                                   | 
            # 08. Increase Throttle            : +=                                  | (See Mouse Ctrl)
            # 09. Decrease Throttle            : -_                                  | (See Mouse Ctrl)
            # 10. Zero Throttle                : Backspace                           | 
            # 11. Max Throttle                 : \                                   | 
            # 12. Match Target Speed           : Y                                   | 
            # 13. Afterburn                    : TAB                                 | (See Mouse Ctrl)
            # 14. Afterburn Toggle             : ~                                   | (See Mouse Ctrl)
            # 15. Autopilot                    : A                                   | 
            # 16. Jump (Excalibur Only)        : J                                   | 
            # 17. Pause                        : Alt-P                               | 
            # 18. Eject                        : Ctrl-E                              | 
            # 19. Calibrate Stick              : Alt-C                               | 
            #------------------------------------------------------------------------|
            #                                                                        |
            # C O M B A T                                                            |
            #                                                                        | 
            # 01. Select Next Target           : T                                   | y
            # 02. Select Next Turret on Current: R                                   | a
            # 03. Lock Target (Toggle)         : L                                   | x
            # 04. Smart Targeting              : CTRL-S                              | b
            # 05. Switch Guns                  : G                                   | d_pad_y -
            # 06. Select Full Guns             : F                                   | d_pad_y +
            # 07. Auto-Tracking                : CTRL-A                              | tl
            # 08. Configure Missile Array      : M                                   | 
            # 09. Change Missile Type          : ]                                   | d_pad_x - 
            # 10. Select Missile (toggle)      : [                                   | d_pad_x +
            # 11. Select All Missiles (Salvo)  : B                                   | tr
            # 12. Fire Guns                    : SPACEBAR                            | rt
            # 13. Fire Missiles                : ENTER                               | lt
            # 14. Drop Decoy                   : E                                   | back
            #------------------------------------------------------------------------| 
            #                                                                        | 
            # N A V I G A T I O N   M A P                                            | 
            #                                                                        | 
            # 01. Display Map                  : N                                   | 
            # 02. Change Viewpoint             : U Arrow, D Arrow, L Arrow, R Arrow  | 
            # 03. Zoom In/Out                  : [ , ]                               | 
            # 04. Center View                  : C                                   | 
            # 05. Cycle through Targets        : T                                   | 
            # 06. Starfield (toggle)           : S                                   | 
            # 07. Grid (toggle)                : G                                   | 
            # 08. Background (Toggle)          : B                                   | 
            #------------------------------------------------------------------------| 
            #                                                                        |
            # V I D E O   D I S P L A Y   U N I T S                                  |
            #                                                                        | 
            # 01. Cycle Through Displays       : 0                                   | 
            # 02. Shields VDU                  : S                                   | 
            # 03. Communications VDU           : C                                   | 
            # 04. Damage VDU (toggle text/icon): D                                   | 
            # 05. Damage Repair                : ]                                   | 
            # 06. Weapon VDU (w cockpit active): W                                   | 
            # 07. Power VDU/ Change System     : P                                   | 
            # 08.   Increase Current System    : ]                                   | 
            # 09.   Decrease Current System    : [                                   | 
            # 10.   Set Current Sys To 100%    : SHIFT - ]                           | 
            # 11.   Reset All Systemsto 25%    : SHIFT - [                           | 
            # 12.   Lock Current Sys (toggle)  : CTRL - ]                            | 
            #                                                                        | 
            #------------------------------------------------------------------------| 
            #                                                                        | 
            # C A M E R A   V I E W S                                                | 
            #                                                                        | 
            # 01. Front View : Invis Cockpit    : F1                                 | 
            # 02. Left, Right, Rear Turret View : F2, F3, F4                         | 
            # 03. Rear Turret in left VDU       : Ctrl-F4                            | 
            # 04. Chase Cam                     : F5                                 | 
            # 05. Object Cam                    : F6                                 | 
            # 06. Missile Cam                   : F8                                 | 
            # 07. Victim Cam                    : F9                                 | 
            # 08. Track Cam                     : F10                                | 
            # 09. Disable Flight Ctrl in Cam    : Ctrl-L                             | 
            # 10. Zoom In, Out                  : [ , ]                              | 
            #                                   :                                    | 
            #------------------------------------------------------------------------| 
            #                                                                        | 
            # M O U S E    C O M M A N D S                                           | 
            #                                                                        |   
            # 01. Flight Cursor Control         : Move Mouse                         | x1, y1
            # 02. Select Hotspot                : Left Click                         | lb
            # 03. Fire Active Gun               : Left Click                         | lb
            # 04. Fire Active Missile           : Both Click                         | rb
            # 05. Increase/Decrease Throttle    : Up/Dwn + Right Click               | x2, y2
            # 06. Roll Left, Right              : L/R + Right Click                  | 
            # 07. Afterburn                     : Double Right Click and Hold        | start 
            #------------------------------------------------------------------------|
            #                                                                        |
            # J O Y S T I C K    C O M M A N D S                                     |
            #                                                                        |
            # 01. Flight Control                : Move Joystick                      | 
            # 02. Fire Active Gun               : Trigger                            | 
            # 03. Fire Active Missile           : Trigger + B2                       | 
            # 04. Rotate Camera                 : B2 + Move Joystick                 | 
            # 05. Increase/Decrease Throttle    : Up/Down B2                         | 
            # 06. Roll Left/Right               : L/R B2                             | 
            # 07. Afterburn                     : B2 Double Click                    | 
            #                                                                        | 
            #------------------------------------------------------------------------|
            #                                                                        | 
            # O N   T H E   C A R R I E R                                            |
            #                                                                        |
            # 01. Activate Person/Obj           : Move Cursor over                   | (See Mouse Ctrl)
            # 02. Use Objects                   : Click                              | (See Mouse Ctrl)
            # 03. Cancel Skip Scene             : Esc                                | guide
            # 04. Cycle Hotspots                : Tab, Shift Tab, Right Mouse        | (See Mouse Ctrl)
            # 05. Talk                          : Click on Character                 | (See Mouse Ctrl)
            # 06. Use                           : Click Terminal or Door             | (See Mouse Ctrl)
            # 07. Select Reply                  : Move Device Up/Dwn - Click         | d_pad_y
            # 08. Option Screen                 : Click Main Terminal                | (See Mouse Ctrl)
            #                                                                        |
            #------------------------------------------------------------------------|
            #                                                                        |
            # G A M E   I N T E R F A C E                                            |
            #                                                                        |
            # 01. Exit Game                     : Alt-X                              |
            # 02. VGA                           : Alt-1                              |
            # 03. VGA (triple buffer)           : Alt-2                              |
            # 04. SVGA                          : Alt-3                              |
            # 05. SVGA (triple buffer)          : Alt-4                              |
            # 06. Calibrate Joystick            : Alt-J                              | 
            # 07. Music (toggle)                : Alt-M                              | 
            # 08. Sound (toggle: on carrier)    : Ctrl-M                             |
            # 09. Scene transition (Toggle)     : Alt-K                              |
            # 09. Change Music Vol              : Alt Up/Dwn                         |  
            # 10. Change Sound Vol              : Ctrl Up/Dwn                        |
            # 11. Change Gamma Correction       : Ctrl Left/Right                    | 
            #                                                                        |
            #------------------------------------------------------------------------|
            

            If anyone needs the PS4 controller map ... here is the one i made ...
            PS4 Controller Map

            I am considering abandoning the ps4 controller idea for this and trying to configure this ... ipazzport

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

              @dunnieboy said in Guide: Advanced Controller Mappings:

              I am considering abandoning the ps4 controller idea for this and trying to configure this ...

              I have on of those lying around here somewhere. Let us know how it works out.

              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

                Ok So this is mostly working now ... just have to tweak some stuff -- running out of slots in the ps4 controller so I might transition to that thing up above.

                Thanks SO much media mogul. One last question ... again ... how do I access the right stick i'd love to use it instead of the dpad for missile selections and use the dpad just for communication(KEY-C), up-arrow, down-arrow and select.

                Here is the config for anyone that is trying to do this -

                #!/bin/bash
                sudo killall >/dev/null xboxdrv
                sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                	--evdev=/dev/input/by-id/usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-event-joystick\
                	--detach-kernel-driver \
                	--deadzone-trigger 15% \
                	--deadzone 4000 \
                	--device-name "donotroller" \
                	--calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767 \
                	--trigger-as-button \
                	--dpad-as-button \
                	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y,ABS_RX=lt,ABS_RY=rt \
                	--evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_START=tl,BTN_SELECT=tr,BTN_THUMBL=guide,BTN_TL2=back,BTN_TR2=start \
                	--axismap -Y1=Y1,-Y2=Y2 \
                	--ui-axismap x1=REL_X:10,y1=REL_Y:10 \
                	--ui-buttonmap a=BTN_LEFT,b=BTN_RIGHT `# mouse buttons`\
                	--ui-buttonmap lb=KEY_KPPLUS,rb=KEY_KPMINUS `# BUMPERS - throttle`\
                	--ui-buttonmap lt=KEY_ENTER,rt=KEY_SPACE `# TRIGGERS - fire missiles, fire guns`\
                	--ui-buttonmap tl=KEY_F,tr=KEY_B `# STICK CLICKS - full guns, full_missiles`\
                	--ui-buttonmap x=KEY_T,guide=KEY_L,y=KEY_LEFTCTRL+KEY_S `# TARGETING - Next Target, Lock, Smart Target`\
                	--ui-buttonmap start=KEY_A,back=KEY_E `# Auto Pilot, Drop Decoy`\
                	--ui-buttonmap dd=KEY_G,du=KEY_M,dl=KEY_RIGHTBRACE,dr=KEY_LEFTBRACE `# DPAD GUN CTRL - Switch Guns, Configure Missiles, Change Missile Type, Select Missiles`\
                	--ui-buttonmap back+start=KEY_ESC `# SKIP SCENE` \
                	-- \
                /opt/retropie/emulators/dosbox/bin/dosbox -conf "/home/pi/RetroPie/roms/pc/wc/wc_3.conf"
                
                mediamogulM 1 Reply Last reply Reply Quote 0
                • mediamogulM
                  mediamogul Global Moderator @dunnieboy
                  last edited by

                  @dunnieboy

                  how do I access the right stick i'd love to use it instead of the dpad

                  Using the keys currently assigned to your DPad, the right stick would be look like:

                  --ui-axismap x2=KEY_RIGHTBRACE:KEY_LEFTBRACE,y2=KEY_M:KEY_G
                  

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

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

                    @mediamogul Everything is working great ... I have all my wing commander games workign great with the PS4 controller.

                    Here is another one for you ... I am trying to use named cycle references on the right stick.

                    --ui-axismap x2=cycle-key-named:views:KEY_F1:KEY_F2:KEY_F3:KEY_F4,:cycle-key-ref:views,y2=cycle-key-named:cams:KEY_F7:KEY_F8:KEY:F9,:cycle-key-ref:cams `# RIGHT STICK L/R = VIEWS, U/D = CAMS`\
                    

                    Any chance you know what I am doing wrong ... its a little tricky because the documentation says to use a comma to seperate pos/neg direction and then uses a button identifier.

                    Thanks

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

                      @dunnieboy

                      I believe the cycle functions can only be used with --ui-buttonmap. The two ends of an axis are separated by a colon and the keys to be cycled through are as well. If I had to guess, that would be causing a conflict.

                      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 that makes sense. Another question ... is there a way to have a bash script read a file for a joystick name ?

                        I am putting all my xboxdrv stuff in each games .sh file. I'd love to use a variable that reads a .txt file for the controller id name.

                        That way instead of :

                        --evdev=/dev/input/by-id/usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-event-joystick\
                        

                        i could use something like

                        --evdev=/dev/input/by-id/%MY_VAR%\
                        

                        and all the .sh files would read that file.

                        Thanks !

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

                          @dunnieboy

                          I suppose you could put the name as the first line of a text file and reference it as $jsname with something like:

                          jsname=`sed '1q;d' /path/to/text/file.txt`
                          

                          However, using that method, you'd still have to have that line in your script, so it's not any easier than just including the name to begin with. I really haven't explored this sort of thing before, so there's probably quite a few better ways and definitely more knowledgeable people to ask.

                          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 Guide: Advanced Controller Mappings:

                            `sed '1q;d'

                            Ok ... I got it working.

                            This file is in /roms/pc/stick_id

                            #!/bin/bash
                            STICKID=usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-event-joystick
                            

                            Here I am reading that variable and all of my .sh game files access that config file for the joystick id. Now I only need to change the id name in one place.

                            #!/bin/bash
                            source ~/RetroPie/roms/pc/stick_id/stick_id.sh
                            sudo killall >/dev/null xboxdrv
                            sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                            	--evdev /dev/input/by-id/$STICKID \
                            	--silent \
                            	--detach-kernel-driver \
                            	--force-feedback \
                            	--deadzone-trigger 15% \
                            	--deadzone 4000 \
                            	--device-name "donotroller" \
                            	--calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767 \
                            	--trigger-as-button \
                            	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_RX=lt,ABS_RY=rt,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \
                            	--evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_START=tl,BTN_SELECT=tr,BTN_THUMBL=guide,BTN_TL2=back,BTN_TR2=start \
                            	--axismap -Y1=Y1,-Y2=Y2 \
                            	--ui-axismap x1=REL_X:10,y1=REL_Y:10 \
                            	--ui-buttonmap lb=BTN_LEFT,rb=BTN_RIGHT \
                            	--ui-buttonmap guide=void,x=void,y=void,a=void,b=void,tl=void,tr=void,lt=void,rt=void,back=void \
                            	--ui-axismap x2=void \
                            	-- \
                            
                            1 Reply Last reply Reply Quote 0
                            • ExarKunIvE
                              ExarKunIv
                              last edited by

                              @mediamogul

                              so i got time to see what other codes come up when i start up stragus

                              here is my mouse mapping for my 8bit do and the left button press

                              Event: time 1491315704.363115, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
                              Event: time 1491315704.363115, -------------- EV_SYN ------------
                              Event: time 1491315704.470595, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
                              Event: time 1491315704.470595, -------------- EV_SYN ------------
                              

                              here is the code for my Rii (it does the same thing where is works kinda)

                              Event: time 1491316054.713802, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
                              Event: time 1491316054.713802, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
                              Event: time 1491316054.713802, -------------- EV_SYN ------------
                              

                              and here is the real mouse that works fine

                              Event: time 1490821100.299279, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
                              Event: time 1490821100.299279, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
                              Event: time 1490821100.299279, -------------- EV_SYN ------------
                              

                              i have no clue on this. i think this might be one that just cant be used with a joypad

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

                                @ExarKunIv

                                When you're using the mouse-mapped controller, is your real mouse still connected? It could be that it's pulling focus in some way.

                                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 did think of that, so all my testing is one at a time with only that device plugged in.

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

                                    @ExarKunIv

                                    The only thing left I can think of is that the software may not be seeing the virtual mouse as being a real mouse in a similar way that RetroArch won't see the virtual keyboard without a udev rule. I would try searching for a similar rule that can be applied to the virtual mouse and see if that might make a difference.

                                    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 ExarKunIv

                                      @mediamogul

                                      ok i'll poke around and see if i can find anything.

                                      EDIT
                                      found this, just will need more time to get a handle on it, way above my pay grade

                                      http://www.embeddedlinux.org.cn/EssentialLinuxDeviceDrivers/final/ch07lev1sec1.html

                                      http://stackoverflow.com/questions/16482260/using-linux-virtual-mouse-driver

                                      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
                                      • S
                                        spud11 @mediamogul
                                        last edited by

                                        @mediamogul Hi mediamogul

                                        I'm just in the process of changing my Amiga setup, so that xboxdrv mimics the default keys for UAE4ARM and amiberry (rather than it mimic the DragonRise joysticks).

                                        My current setup works perfectly, but the reason I'm doing this is so that I can get to the menu and exit without using the keyboard at all.

                                        However, I can't seem to get any keys to work in game with UAE4ARM. I've tested UAE4ARM with and without xboxdrv operating and pressing every key on the keyboard does nothing (except F12 which definitely works).

                                        I know you've got your Logitech F710 mimicking the keys. Could I please ask whether you did anything special to get the keys to work in game? I've got individual .uae files for each game. Is there anything in the .uae file that I should have or change? An example .uae appears below:

                                        config_description=Alien Breed Special Edition '92
                                        config_hardware=true
                                        config_host=true
                                        config_version=2.8.1
                                        
                                        ; original paths
                                        pandora.rom_path=/opt/retropie/emulators/uae4arm/kickstarts/
                                        pandora.floppy_path=/opt/retropie/emulators/uae4arm/disks/
                                        pandora.hardfile_path=/opt/retropie/emulators/uae4arm/
                                        pandora.cd_path=/opt/retropie/emulators/uae4arm/cd32/
                                        
                                        ; Controller Config
                                        joyport0=joy1
                                        joyport0autofire=none
                                        joyport0mode=djoy
                                        joyportname0=JOY1
                                        joyport1=joy3
                                        joyport1autofire=none
                                        joyport1mode=djoy
                                        joyportname1=JOY3
                                        joyportfriendlyname0=Player_2
                                        joyportfriendlyname1=Player_1
                                        
                                        input.config=0
                                        input.joymouse_speed_analog=2
                                        input.joymouse_speed_digital=10
                                        input.joymouse_deadzone=33
                                        input.joystick_deadzone=33
                                        input.analog_joystick_multiplier=15
                                        input.analog_joystick_offset=-1
                                        input.mouse_speed=100
                                        input.autofire_speed=2496
                                        input.autofire=8
                                        
                                        key_for_menu=293
                                        key_for_quit=27
                                        button_for_menu=-1
                                        button_for_quit=8
                                        
                                        
                                        ; host-specific
                                        pandora.cpu_speed=600
                                        pandora.joy_conf=0
                                        pandora.joy_port=0
                                        pandora.stylus_offset=0
                                        pandora.tap_delay=10
                                        pandora.custom_controls=0
                                        pandora.custom_dpad=0
                                        pandora.custom_up=-5
                                        pandora.custom_down=-6
                                        pandora.custom_left=-7
                                        pandora.custom_right=-8
                                        pandora.custom_a=-3
                                        pandora.custom_b=-4
                                        pandora.custom_x=0
                                        pandora.custom_y=0
                                        pandora.custom_l=0
                                        pandora.custom_r=0
                                        
                                        pandora.move_x=0
                                        pandora.move_y=0
                                        
                                        pandora.button1=2
                                        pandora.button2=1
                                        pandora.autofire_button=3
                                        
                                        pandora.jump=-1
                                        
                                        ; Common
                                        use_gui=no
                                        kickstart_rom_file=$(FILE_PATH)/kick205.rom
                                        kickstart_ext_rom_file=$(FILE_PATH)/
                                        
                                        ; Floppy Drives
                                        
                                        ;floppy0=/home/pi/RetroPie/roms/amiga/Games_WHDLoad/
                                        ;floppy0type=0
                                        ;floppy1=/home/pi/RetroPie/roms/amiga/Games_WHDLoad/
                                        ;floppy1type=0
                                        ;floppy2=/home/pi/RetroPie/roms/amiga/Games_WHDLoad/
                                        ;floppy2type=0
                                        ;floppy3=/home/pi/RetroPie/roms/amiga/Games_WHDLoad/
                                        ;floppy3type=0
                                        nr_floppies=0
                                        floppy_speed=800
                                        
                                        ; Hard Drives
                                        filesystem2=rw,DH0:DH0:/home/pi/RetroPie/roms/amiga/_BootWHD/,10
                                        uaehf1=dir,rw,DH0:DH0:/home/pi/RetroPie/roms/amiga/_BootWHD/,10
                                        
                                        filesystem2=rw,DH1:games:/home/pi/RetroPie/roms/amiga/Games_WHDLoad/AlienBreedSpecialEdition/,0
                                        uaehf0=dir,rw,DH1:games:/home/pi/RetroPie/roms/amiga/Games_WHDLoad/AlienBreedSpecialEdition/,0
                                        
                                        ;filesystem2=rw,DH2:HDFGame:/home/pi/RetroPie/roms/amiga/Games_WHDLoad/AlienBreedSpecialEdition,32,1,2,512,50,,uae
                                        ;hardfile2=dir,rw,DH2:HDFGame:/home/pi/RetroPie/roms/amiga/Games_WHDLoad/AlienBreedSpecialEdition,32,1,2,512,50,,uae
                                        
                                        
                                        ; Display / Screen Setup
                                        gfx_framerate=0
                                        gfx_width=640
                                        gfx_height=262
                                        gfx_width_windowed=320
                                        gfx_height_windowed=240
                                        gfx_width_fullscreen=640
                                        gfx_height_fullscreen=480
                                        gfx_lores=false
                                        gfx_resolution=hires
                                        gfx_correct_aspect=False
                                        ntsc=False
                                        
                                        ; CPU options
                                        cpu_type=68020
                                        cpu_speed=real
                                        finegrain_cpu_speed=1024
                                        ;cpu_model=<<cpumodel>>
                                        cpu_compatible=False
                                        cpu_24bit_addressing=True
                                        cachesize=8192
                                        
                                        ; Memory 
                                        a1000ram=false
                                        chipmem_size=4
                                        bogomem_size=0
                                        fastmem_size=8
                                        z3mem_size=0
                                        z3mem_start=0x1000000
                                        
                                        ; Chipset 
                                        chipset=ECS_Agnus
                                        chipset_refreshrate=0.000000
                                        collision_level=playfields
                                        fast_copper=True
                                        immediate_blits=False
                                        
                                        rtg_nocustom=true
                                        rtg_modes=0x502
                                        gfxcard_size=0
                                        gfxcard_type=ZorroIII
                                        
                                        ; Misc
                                        bsdsocket_emu=False
                                        show_leds=false
                                        kbd_led_num=-1
                                        kbd_led_scr=-1
                                        kbd_led_cap=-1
                                        
                                        ; Sound
                                        sound_output=exact
                                        sound_channels=stereo
                                        sound_stereo_separation=7
                                        sound_stereo_mixing_delay=0
                                        sound_frequency=44100
                                        sound_interpol=none
                                        sound_filter=off
                                        sound_filter_type=standard
                                        sound_volume_cd=20
                                        sound_auto=yes
                                        synchronize_clock=yes
                                        

                                        In terms of my runcommand-onstart, the relevant setup is Player1_Amiga below. I've commented out the keys.

                                        #!/bin/sh
                                        ### Uncomment one or all of the following if you need to find some information about the emulator or roms
                                        ### Name of the emulator
                                        #echo $1 >> /dev/shm/runcommand.log
                                        
                                        ### Name of the software used for running the emulation
                                        #echo $2 >> /dev/shm/runcommand.log
                                        
                                        ### Name of the rom
                                        #echo $3 >> /dev/shm/runcommand.log
                                        
                                        ### Executed command line
                                        #echo $4 >> /dev/shm/runcommand.log
                                        
                                        
                                        ### Code begins
                                        ### Game/ROM full path
                                        rom="${3##*/}"
                                        
                                        ### Set variables for joysticks and emulators
                                        ### Basic Configurations - Standard controller mappings for the 4 Arcade (DragonRise) joysticks - map Arcade joysticks to XBox 360 Controller and then map to keyboard.
                                        ### Remove " > /dev/null 2>&1 " from first line to see information when xboxdrv starts
                                        ### Second: Remember to change the 99-xboxdrv file in /etc/udev/rules.d/ to the following:
                                        ### SUBSYSTEM=="input", ATTRS{name}=="Player_1", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
                                        ### SUBSYSTEM=="input", ATTRS{name}=="Player_2", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
                                        ### SUBSYSTEM=="input", ATTRS{name}=="Player_3", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
                                        ### SUBSYSTEM=="input", ATTRS{name}=="Player_4", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
                                        
                                        
                                        ### ARCADE - LR-MAME2003 - THIS CORE HAS ITS OWN KEYS SET UP VIA THE TAB MENU - The mappings below enable the joysticks to operate in 4-Way or 8-Way mode depending on the game.
                                        ### First: Using the TAB menu in lr-mame2003 and other emulators, either make note of the default keyboard controls and map the code below accordingly or in TAB map Player 1's and Player 2's controls to the keyboard controls you want and then map the code below.
                                        ### Player1_4Way_Mame and Player2_4Way_Mame map Joysticks 1 and 2 with four way restriction for use with lr-mame2003.
                                        Player1_4Way_Mame="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \
                                        --device-name "Player_1" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --four-way-restrictor \
                                        --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_BASE3=back,BTN_BASE6=start \
                                        --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \
                                        --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        Player2_4Way_Mame="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.1:1.0-event-joystick \
                                        --device-name "Player_2" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --four-way-restrictor \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_D:KEY_G,Y1=KEY_R:KEY_F \
                                        --ui-buttonmap a=KEY_A,b=KEY_S,x=KEY_Q,y=KEY_W,back=KEY_6+KEY_2,start=KEY_UNKNOWN,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        ### Player3_4Way_Mame and Player4_4Way_Mame map Joysticks 3 and 4 with four way restriction for use with lr-mame2003.
                                        Player3_4Way_Mame="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.2:1.0-event-joystick \
                                        --device-name "Player_3" \
                                        --evdev-absmap ABS_X=x1,ABS_Y=y1 \
                                        --four-way-restrictor \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_DOWN:KEY_UP,Y1=KEY_RIGHT:KEY_LEFT \
                                        --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        Player4_4Way_Mame="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.4:1.0-event-joystick \
                                        --device-name "Player_4" \
                                        --evdev-absmap ABS_X=x1,ABS_Y=y1 \
                                        --four-way-restrictor \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_BASE=lb,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_F:KEY_R,Y1=KEY_G:KEY_D \
                                        --ui-buttonmap a=KEY_A,b=KEY_S,x=KEY_Q,y=KEY_W,back=KEY_6+KEY_2,lb=KEY_UNKNOWN,start=KEY_UNKNOWN,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        ### Player1_8Way_Mame and Player2_8Way_Mame map Joysticks 1 and 2 with no restriction for use with lr-mame2003
                                        Player1_8Way_Mame="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \
                                        --device-name "Player_1" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_BASE3=back,BTN_BASE6=start \
                                        --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \
                                        --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        Player2_8Way_Mame="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.1:1.0-event-joystick \
                                        --device-name "Player_2" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_D:KEY_G,Y1=KEY_R:KEY_F \
                                        --ui-buttonmap a=KEY_A,b=KEY_S,x=KEY_Q,y=KEY_W,back=KEY_6+KEY_2,start=KEY_UNKNOWN,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        ### Player3_8Way_Mame and Player4_8Way_Mame map Joysticks 3 and 4 with no restriction for use with lr-mame2003
                                        Player3_8Way_Mame="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.2:1.0-event-joystick \
                                        --device-name "Player_3" \
                                        --evdev-absmap ABS_X=x1,ABS_Y=y1 \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_DOWN:KEY_UP,Y1=KEY_RIGHT:KEY_LEFT \
                                        --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        Player4_8Way_Mame="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.4:1.0-event-joystick \
                                        --device-name "Player_4" \
                                        --evdev-absmap ABS_X=x1,ABS_Y=y1 \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_BASE=lb,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_F:KEY_R,Y1=KEY_G:KEY_D \
                                        --ui-buttonmap a=KEY_A,b=KEY_S,x=KEY_Q,y=KEY_W,back=KEY_6+KEY_2,lb=KEY_UNKNOWN,start=KEY_UNKNOWN,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        ### Player1_Amiga and Player2_Amiga are for the UAE4ARM emulator and fixes the axes for Players 1 and 2.  Not mapped to the keyboard.
                                        Player1_Amiga="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \
                                        --device-name "Player_1" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_BASE3=back,BTN_BASE6=start"
                                        ## --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \
                                        ## --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_LEFTSHIFT,y=KEY_UNKNOWN,back=KEY_UNKNOWN,start=KEY_UNKNOWN,back+start=KEY_F12"
                                        
                                        Player2_Amiga="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.1:1.0-event-joystick \
                                        --device-name "Player_2" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start"
                                        
                                        
                                        ### ARCADE - LR-FBALPHA - USES RETROARCH KEYS - The mappings below enable the joysticks to operate either in 4-Way or in 8-Way mode depending on the game.
                                        ### CORE INPUT REMAPPING - in a game (eg Bubble Bobble), hold "space" and press "F1" to enter lr-fbalpha's Retroarch menu.  Note: I've set up my Player 1 joystick in Retroarch's general menu so that the button formation is A, B, X and Y (most like the XBox 360 Controller formation).  However, Retroarch and lr-fbalpha mimic the SNES Controller.  With the SNES Controller, Button Y is the fire button and Button B is the jump button.  So that the first button (Button A) on my DragonRise controller is the "fire" button, enter core input remapping, quick menu, controls and change the "fire" button from Y to A for both Players 1 and 2.  Remember to "Save Core Remap".  This will mean that the "fire" button (A) and the "jump" button (B) are now next to each other - no stretching of fingers required.  (Also, now there is no need for a separate rom config file in roms folder).
                                        ### Player1_4Way_FBA and Player2_4Way_FBA map Joysticks 1 and 2 with four way restriction for use with libretro emulators other than lr-mame2003.  The keyboard mappings below are the same keys that are mapped for Users 1 and 2 in Retroarch.
                                        ### For Player 1, the Select (back) button will now start Player 1 and the Start key will now start Player 2; holding down the Select button and pressing the Start button will exit the emulator.  For Player 2, Select and Start do nothing.  For Player 3, Select is Coin 1 and Start will start Player 3.  Hold down Select and press Start will exit.  For Player 4, Select is Coin 2 and Start will start Player 4 and Player 3.  Holding down both will exit the emulator.
                                        Player1_4Way_FBA="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \
                                        --device-name "Player_1" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --four-way-restrictor \
                                        --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_TOP2=lb,BTN_TOP=rb,BTN_BASE3=back,BTN_BASE6=start \
                                        --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \
                                        --ui-buttonmap a=KEY_X,b=KEY_Z,x=KEY_S,y=KEY_A,lb=KEY_Q,rb=KEY_W,back=KEY_RIGHTSHIFT+KEY_ENTER,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        Player2_4Way_FBA="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap back=void,start=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.1:1.0-event-joystick \
                                        --device-name "Player_2" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --four-way-restrictor \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=lb,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=rb \
                                        --ui-axismap X1=KEY_D:KEY_G,Y1=KEY_R:KEY_F \
                                        --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,lb=KEY_V,rb=KEY_B"
                                        
                                        ### Player3_4Way_FBA and Player4_4Way_FBA map Joysticks 3 and 4 with four way restriction for use with libretro emulators other than lr-mame2003.  The keyboard mappings below are the same keys that are mapped for Users 1 and 2 in Retroarch (with axes appropriately altered).
                                        Player3_4Way_FBA="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.2:1.0-event-joystick \
                                        --device-name "Player_3" \
                                        --evdev-absmap ABS_X=x1,ABS_Y=y1 \
                                        --four-way-restrictor \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_DOWN:KEY_UP,Y1=KEY_RIGHT:KEY_LEFT \
                                        --ui-buttonmap a=KEY_X,b=KEY_Z,x=KEY_S,y=KEY_A,back=KEY_RIGHTSHIFT,start=KEY_ENTER,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        Player4_4Way_FBA="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.4:1.0-event-joystick \
                                        --device-name "Player_4" \
                                        --evdev-absmap ABS_X=x1,ABS_Y=y1 \
                                        --four-way-restrictor \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_BASE=lb,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_F:KEY_R,Y1=KEY_G:KEY_D \
                                        --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_6,lb=KEY_UNKNOWN,start=KEY_2,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        ### Player1_8Way_FBA and Player2_8Way_FBA map Joysticks 1 and 2 with no restriction for use with libretro emulators other than lr-mame2003.  The keyboard mappings below are the same keys that are mapped for Users 1 and 2 in Retroarch.
                                        Player1_8Way_FBA="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \
                                        --device-name "Player_1" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_BASE3=back,BTN_BASE6=start \
                                        --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \
                                        --ui-buttonmap a=KEY_X,b=KEY_Z,x=KEY_S,y=KEY_A,lb=KEY_Q,rb=KEY_W,back=KEY_RIGHTSHIFT+KEY_ENTER,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        Player2_8Way_FBA="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap back=void,start=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.1:1.0-event-joystick \
                                        --device-name "Player_2" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_D:KEY_G,Y1=KEY_R:KEY_F \
                                        --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,lb=KEY_V,rb=KEY_B"
                                        
                                        ### Player3_8Way_FBA and Player4_8Way_FBA map Joysticks 3 and 4 with no restriction for use with libretro emulators other than lr-mame2003.  The keyboard mappings below are the same keys that are mapped for Users 1 and 2 in Retroarch (with axes appropriately altered).
                                        Player3_8Way_FBA="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.2:1.0-event-joystick \
                                        --device-name "Player_3" \
                                        --evdev-absmap ABS_X=x1,ABS_Y=y1 \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_DOWN:KEY_UP,Y1=KEY_RIGHT:KEY_LEFT \
                                        --ui-buttonmap a=KEY_X,b=KEY_Z,x=KEY_S,y=KEY_A,back=KEY_RIGHTSHIFT,start=KEY_ENTER,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        Player4_8Way_FBA="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.4:1.0-event-joystick \
                                        --device-name "Player_4" \
                                        --evdev-absmap ABS_X=x1,ABS_Y=y1 \
                                        --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_BASE=lb,BTN_TOP=b,BTN_TOP2=start \
                                        --ui-axismap X1=KEY_F:KEY_R,Y1=KEY_G:KEY_D \
                                        --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_6,lb=KEY_UNKNOWN,start=KEY_2,back+start=KEY_SPACE+KEY_ESC"
                                        
                                        ### Gameboy Advance Emulator GPSP defaults to Player 2's joystick.  Player1_gpsp enables Player 1's joystick to operate simultaneously with Player 2's joystick, as Player 1's joystick is mapped to the default keys.  The default keys are D-Pad = up/down/left/right; A Button = z; B Button = x; left trigger = a; right trigger = s; start = enter; select = backspace.
                                        Player1_gpsp="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        --silent \
                                        --detach-kernel-driver \
                                        --deadzone=4000 \
                                        --deadzone-trigger 15% \
                                        --force-feedback \
                                        --mimic-xpad \
                                        --trigger-as-button \
                                        --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
                                        --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \
                                        --device-name "Player_1" \
                                        --evdev-absmap ABS_X=y1,ABS_Y=x1 \
                                        --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_BASE3=back,BTN_BASE6=start \
                                        --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \
                                        --ui-buttonmap a=KEY_Z,b=KEY_X,x=KEY_A,y=KEY_S,back=KEY_BACKSPACE,start=KEY_ENTER,back+start=KEY_ESC"
                                        
                                        ### Arcade Games that use 4 way restricted joysticks - 208 of 208 identified games plus Arkanoid and Tempest derivatives
                                        RestrictedArcadeGames=""alibaba.zip"|"amidar.zip"|"armwrest.zip"|"astinvad.zip"|"atetris.zip"|"anteater.zip"|"armorcar.zip"|"astrob.zip"|"astrof.zip"|"bagman.zip"|"ballbomb.zip"|"barrier.zip"|"blkhole.zip"|"blasto.zip"|"blockade.zip"|"btime.zip"|"carjmbre.zip"|"carnival.zip"|"cavelon.zip"|"chameleo.zip"|"checkman.zip"|"chinhero.zip"|"circusc.zip"|"ckong.zip"|"commando.zip"|"congo.zip"|"dazzler.zip"|"devilfsh.zip"|"digdug.zip"|"digdug2.zip"|"digger.zip"|"disco.zip"|"dkong.zip"|"dkong3.zip"|"dkongjr.zip"|"docastle.zip"|"dommy.zip"|"dorodon.zip"|"frogger.zip"|"galaga.zip"|"galaxian.zip"|"galxwars.zip"|"guzzler.zip"|"invrvnge.zip"|"invinco.zip"|"jjack.zip"|"joust2.zip"|"jrpacman.zip"|"jumpcoas.zip"|"jungler.zip"|"kchamp.zip"|"kicker.zip"|"kingball.zip"|"ladybug.zip"|"lasso.zip"|"levers.zip"|"lnc.zip"|"locomotn.zip"|"logger.zip"|"lrescue.zip"|"lupin3.zip"|"mappy.zip"|"marvins.zip"|"mikie.zip"|"mmonkey.zip"|"monsterb.zip"|"moonal2.zip"|"moonqsr.zip"|"mrdo.zip"|"mrflea.zip"|"mrjong.zip"|"mrtnt.zip"|"mspacman.zip"|"mystston.zip"|"naughtyb.zip"|"netwars.zip"|"olibochu.zip"|"ozmawars.zip"|"pacnpal.zip"|"pacplus.zip"|"pengo.zip"|"perestro.zip"|"pickin.zip"|"pignewt.zip"|"pisces.zip"|"pleiads.zip"|"pooyan.zip"|"popflame.zip"|"puckman.zip"|"pacman.zip"|"pulsar.zip"|"qbert.zip"|"qbertqub.zip"|"qix.zip"|"radarscp.zip"|"retofinv.zip"|"rocnrope.zip"|"route16.zip"|"samurai.zip"|"tsamurai.zip"|"scregg.zip"|"sindbadm.zip"|"solarfox.zip"|"sonofphx.zip"|"invadpt2.zip"|"panic.zip"|"shollow.zip"|"spclaser.zip"|"sqbert.zip"|"streakng.zip"|"sbagman.zip"|"superpac.zip"|"superqix.zip"|"ssi.zip"|"swat.zip"|"tactcian.zip"|"tankbatt.zip"|"taxidrvr.zip"|"elecyoyo.zip"|"theend.zip"|"timelimt.zip"|"tomahawk.zip"|"todruaga.zip"|"tranqgun.zip"|"triplep.zip"|"tutankhm.zip"|"vanvan.zip"|"volfied.zip"|"vsgongf.zip"|"wiping.zip"|"warpwarp.zip"|"zigzag.zip"|"zzyzzyxx.zip"|"alphaho.zip"|"pacnchmp.zip"|"comotion.zip"|"copsnrob.zip"|"cosmicg.zip"|"cosmos.zip"|"crash.zip"|"crush.zip"|"redufo.zip"|"diamond.zip"|"dorunrun.zip"|"dominos.zip"|"drmicro.zip"|"drgnbstr.zip"|"dremshpr.zip"|"elvactr.zip"|"eyes.zip"|"firetrap.zip"|"40love.zip"|"galpanic.zip"|"gundealr.zip"|"hardhat.zip"|"headon.zip"|"headon2.zip"|"heiankyo.zip"|"hexa.zip"|"hustle.zip"|"intrepid.zip"|"ironhors.zip"|"karianx.zip"|"kungfum.zip"|"lvgirl94.zip"|"logicpro.zip"|"logicpr2.zip"|"msjiken.zip"|"kikcubic.zip"|"mineswpr.zip"|"mtrap.zip"|"dowild.zip"|"mrgoemon.zip"|"natodef.zip"|"rallyx.zip"|"nrallyx.zip"|"pepper2.zip"|"pettanp.zip"|"popeye.zip"|"punchout.zip"|"raiders5.zip"|"rampage.zip"|"reikaids.zip"|"robby.zip"|"rthunder.zip"|"sidetrac.zip"|"schaser.zip"|"spaceinv.zip"|"spacezap.zip"|"spectar.zip"|"springer.zip"|"stratvox.zip"|"sia2650.zip"|"spnchout.zip"|"tapper.zip"|"rbtapper.zip"|"targ.zip"|"telmahjn.zip"|"theglob.zip"|"thief.zip"|"timber.zip"|"toypop.zip"|"wwjgtin.zip"|"wndrmomo.zip"|"yamyam.zip"|"zerozone.zip"|"zookeep.zip"|"pairs.zip"|"higemaru.zip"|"elecyoy2.zip"|"arkangc.zip"|"arkanoid.zip"|"arkatayt.zip"|"arkatour.zip"|"arkbl2.zip"|"arkbl3.zip"|"arkbloc2.zip"|"arkblock.zip"|"arknid2j.zip"|"arknid2u.zip"|"arknoid2.zip"|"arknoidj.zip"|"arknoidu.zip"|"arknoiuo.zip"|"arkretrn.zip"|"tempest.zip"|"tempest1.zip"|"tempest2.zip"|"tempest3.zip"|"temptube.zip""
                                        
                                        
                                        ### Kill xboxdrv
                                        xboxkill="sudo killall xboxdrv"
                                        
                                        ### Execute the driver with the configuration needed
                                        ### $1 is the name of the system emulation (eg mame-libretro), not the name of the emulator (eg not lr-mame2003), nor the name of the folder (eg not "arcade", not "mame-libretro", not "arcade-vertical"
                                        ### $1 - The system (eg: atari2600, nes, snes, megadrive, fba, etc).
                                        ### $2 - The emulator (eg: lr-stella, lr-fceumm, lr-picodrive, pifba, etc).
                                        ### $3 - The full path to the rom file.
                                        ### $4 - The full command line used to launch the emulator.
                                        ### This information can be obtained from /dev/shm/runcommand.info
                                        case $2 in
                                        
                                        	lr-mame2003)
                                        	case $rom in
                                        			$RestrictedArcadeGames) # Configuration only for these ROMs. Players 1 and 3 mapped to the same keys; Players 2 and 4 mapped to the same keys; All joysticks work simultaneously in portrait and landscape modes.
                                        				$xboxkill
                                        				joycommand="$Player1_4Way_Mame & $Player2_4Way_Mame & $Player3_4Way_Mame & $Player4_4Way_Mame &"
                                        				eval $joycommand
                                        			;;
                                        			*) # Configuration for every other ROM. Players 1 and 3 mapped to the same keys; Players 2 and 4 mapped to the same keys; All joysticks work simultaneously in portrait and landscape modes.
                                        				$xboxkill
                                        				joycommand="$Player1_8Way_Mame & $Player2_8Way_Mame & $Player3_8Way_Mame & $Player4_8Way_Mame &"
                                        				eval $joycommand
                                        			;;
                                        		esac
                                        	;;
                                        	
                                        	uae4arm)
                                        		$xboxkill
                                        		joycommand="$Player1_Amiga & $Player2_Amiga &"
                                        		eval $joycommand
                                        	;;
                                        	
                                        	gpsp)
                                        		$xboxkill
                                        		joycommand="$Player1_gpsp &"
                                        		eval $joycommand
                                        	;;
                                        	
                                        	lr-fbalpha)
                                        	case $rom in
                                        		$RestrictedArcadeGames) # Configuration only for these ROMs. Players 1 and 3 mapped to the same keys; Players 2 and 4 mapped to the same keys; All joysticks work simultaneously in portrait and landscape modes.
                                        				$xboxkill
                                        				joycommand="$Player1_4Way_FBA & $Player2_4Way_FBA & $Player3_4Way_FBA & $Player4_4Way_FBA &"
                                        				eval $joycommand
                                        			;;
                                        			*) # Configuration for every other ROM. Players 1 and 3 mapped to the same keys; Players 2 and 4 mapped to the same keys; All joysticks work simultaneously in portrait and landscape modes.
                                        				$xboxkill
                                        				joycommand="$Player1_8Way_FBA & $Player2_8Way_FBA & $Player3_8Way_FBA & $Player4_8Way_FBA &"
                                        				eval $joycommand
                                        			;;
                                        		esac
                                        	;;
                                        	
                                        esac
                                        
                                        
                                        
                                        ###	advmame-1.4)
                                        ###	case $rom in
                                        ###			$RestrictedArcadeGames) # Configuration used only for these ROMs
                                        ###				$xboxkill
                                        ###				joycommand="$Player1_4Way & $Player2_4Way & $Player3_4Way & $Player4_4Way &"
                                        ###				eval $joycommand
                                        ###			;;
                                        ###			*) # Configuration for every other ROM in respect of this emulator
                                        ###				$xboxkill
                                        ###				joycommand="$Player1_8Way & $Player2_8Way & $Player3_8Way & $Player4_8Way &"
                                        ###				eval $joycommand
                                        ###			;;
                                        ###		esac
                                        ###	;;
                                        

                                        Thanks so much.

                                        RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                        E mediamogulM 2 Replies Last reply Reply Quote 0
                                        • E
                                          EctoOne @spud11
                                          last edited by EctoOne

                                          @spud11
                                          I think it's

                                          key_for_menu=293
                                          key_for_quit=27
                                          

                                          But what i did was to map F12 (default open GUI key) to my Guide Button on my F710 and Guide+X is Q (default Quit when the GUI is open). So when i press Guide i get the GUI, when i hold Guide and press X, the Menu Pops up for a second and then quits Amiberry.

                                          1 Reply Last reply Reply Quote 2
                                          • mediamogulM
                                            mediamogul Global Moderator @spud11
                                            last edited by

                                            @spud11

                                            @EctoOne is right on the money. Using his example, where he mapped the 'Escape' key (27) to exit, you could also mirror RetroArch's functionality and exit immediately with:

                                            --ui-buttonmap back+start=KEY_ESC
                                            

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

                                            S 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.