@mnmagri
I'm not sure how far you got when setting up Moonlight but you need to find your controller's ID number and the correct corresponding button numbers by using jstest /dev/input/js0
Then you add this information into /usr/share/moonlight/gamecontrollerdb.txt
This is because Moonlight decided to use an SDL gamecontrollerdb.txt format to be able to make common game controllers work out-of-the-box. Here's the official template file:
https://github.com/irtimmer/moonlight-embedded/blob/master/gamecontrollerdb.txt
Here is the information for my wireless Xbox 360 controller. Warning: my d-pad settings are not correct and I've been meaning to fix this but I'm too lazy to do it right now!. They differ a little depending if you're using the Xpad driver or the Xboxdrv driver.
Xpad version:
030000005e040000a102000007010000,X360 Wireless Controller,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,lefttrigger:b6,righttrigger:b7,back:b8,start:b9,guide:b10,leftstick:b11,rightstick:b12,dpleft:b13,dpright:b14,dpup:b15,dpdown:b16,leftx:a0,lefty:a1,rightx:a2,righty:a3,platform:Linux,
Xboxdrv version:
030000005e040000a102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
More information here (Xbox 360 Wireless Receiver mapping chart):
https://github.com/irtimmer/moonlight-embedded/issues/514#issuecomment-310163270