Moonlight game controller mapping



  • I installed latest recalbox. I paired my ipega 9025 controller and It works well with kodi and ES.
    But It doesn't go well with moonlight.
    I found out auto generated gamecontrollerdb.txt includes wrong button mappings like below

    0500000049190000020400001b010000,ipega media gamepad controller,platform:Linux,b:b168,righty:a3,rightx:a2,a:b167,x:b170,righttrigger:b176,rightstick:b181,leftshoulder:b173,dpup:h0.1,start:b178,dpdown:h0.4,rightshoulder:b174,dpright:h0.2,lefttrigger:b175,leftstick:b180,guide:b141,y:b171,lefty:a1,leftx:a0,back:b177,dpleft:h0.8,
    

    I tried to edit it manually but every time I launch a game with moonlight, Recalbox overwrites it.

    Any advise will be appreciated!



  • @jinuk-ahn why is it wrong ?



  • @Substring Axis mappings are right, but button mapping start at b167. It's obviously weird.



  • @jinuk-ahn so what ? what's wrong with it ? doesn't work ?



  • @Substring yes, It doesn't work. All buttons don't response. And that's why I wrote this thread.



  • @jinuk-ahn button numbers get that high especially if the pad also advertises keyboard. Reading http://upload.sunsky-online.com/res/drivers/PG-9025.pdf have you started it as gamepad mode ?



  • @Substring
    Yes, I did. I connected my game controller into Windows 10 PC and tested it with a tool that can get sld key mappings http://www.generalarcade.com/gamepadtool/

    03000000491900000204000000000000,Ipega PG-9023,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
    

    I've got above in Windows 10. As you see button number looks more reasonable than Recalbox generated key mappings.

    I found out that es_input.cfg also has unreasonable numbers on buttons.

    <inputConfig type="joystick" deviceName="ipega media gamepad controller" deviceGUID="0500000049190000020400001b010000" deviceNbAxes="6" deviceNbHats="1" deviceNbButtons="183">
    		<input name="a" type="button" id="168" value="1" code="305" />
    		<input name="b" type="button" id="167" value="1" code="304" />
    		<input name="down" type="hat" id="0" value="4" code="16" />
    		<input name="hotkey" type="button" id="141" value="1" code="164" />
    		<input name="joystick1left" type="axis" id="0" value="-1" code="0" />
    		<input name="joystick1up" type="axis" id="1" value="-1" code="1" />
    		<input name="joystick2left" type="axis" id="2" value="-1" code="2" />
    		<input name="joystick2up" type="axis" id="3" value="-1" code="5" />
    		<input name="l2" type="button" id="175" value="1" code="312" />
    		<input name="l3" type="button" id="180" value="1" code="317" />
    		<input name="left" type="hat" id="0" value="8" code="16" />
    		<input name="pagedown" type="button" id="174" value="1" code="311" />
    		<input name="pageup" type="button" id="173" value="1" code="310" />
    		<input name="r2" type="button" id="176" value="1" code="313" />
    		<input name="r3" type="button" id="181" value="1" code="318" />
    		<input name="right" type="hat" id="0" value="2" code="16" />
    		<input name="select" type="button" id="177" value="1" code="314" />
    		<input name="start" type="button" id="178" value="1" code="315" />
    		<input name="up" type="hat" id="0" value="1" code="16" />
    		<input name="x" type="button" id="171" value="1" code="308" />
    		<input name="y" type="button" id="170" value="1" code="307" />
    	</inputConfig>
    


  • @jinuk-ahn that's because our sdl is patched yo find more buttons. But the patch was made by someone who had a good idea but made it dirtily. I really think about making this the rught way, but some pad configueations will be wrong, people will have to recinfigure their pads, most ppl will shout at us ...



  • @Substring
    Thank you for your answer, Can you tell how to configure my controller manually? Or should I go back to Recalbox 4.1 and wait until SDL get patched?



  • @jinuk-ahn not 4.1, but the release before the Moonlight upgrade. Still, it should work, i should look at the Moonlight source code but i'm away for holidays



  • @Substring
    Thank you! and spend nice holidays.



  • I found the solution, I write this for someone who have same issue.

    I edited config files like below and it worked!

    \RECALBOX\share\system\configs\moonlight (SMB)

    gamecontrollerdb.txt - Duplicate and rename it ex)gamecontrollerdb_fixed.txt , Edit button number to what you got in SDL2 Gamepad Tool (http://www.generalarcade.com/gamepadtool/)

    0500000049190000020400001b010000,ipega media gamepad controller,platform:Linux,b:b1,righty:a3,rightx:a2,a:b0,x:b3,righttrigger:b9,rightstick:b14,leftshoulder:b6,dpup:h0.1,start:b11,dpdown:h0.4,rightshoulder:b7,dpright:h0.2,lefttrigger:b8,leftstick:b13,y:b4,lefty:a1,leftx:a0,back:b10,dpleft:h0.8,
    

    moonlight.conf - Uncomment mapping and write the path of edited gamecontrollerdb

    ## Default used mapping for streaming
    ## Searched for in $XDG_DATA_DIRS/moonlight or /usr/share/moonlight and /usr/local/share/moonlight
    ## Mapping can also be user overrided in $XDG_CONFIG_DIR/moonlight or ~/.config/moonlight or current directory
    mapping = /recalbox/share/system/configs/moonlight/gamecontrollerdb_fixed.txt
    

Log in to reply
 

Want to support us ?

Join us on :

203
Online

31033
Users

15111
Topics

113715
Posts

Looks like your connection to Recalbox Forum was lost, please wait while we try to reconnect.