My friends and I have used wired 360 controllers for the longest time to game on pc but one of my friends has since switched to using his DS4 and he’s reporting that my games /do not work/ with his ps4 controller, only the 360. A little searching around and I find this was an XNA issue to do with PS4 pads not supporting xInput or somesuch?
This is a bit concerning as they are a lot more wide spread now - I don’t know how well supported they are on max/nix but certainly in windows you just plug em in and they appear as a game controller these days. Other games he tested such as rocket league all worked fine so I assume it truely is an xna/mono issue.
Has anyone got any fixes or work-arounds for this? Especially multiplatform ones? Would suck to alienate certain controllers!
DS4Windows application. Takes DualShock 4 input and makes PC think it’s an Xbox controller.
yeah I read something about that - but that is asking my users to a) fix my problem and b) change their software configuration to do so - its a bit of an ask especially in an age where people expect to just run something and have it work
I figured there would be some extensions to the input modules in mono by now - but maybe not
If you use MG cross platform desktop project the dualshock controller should work.
MonoGame for Windows DX projects only uses XInput, not DirectInput which is an older lower level API that MS no longer recommends using for gamepads. But since dualshock gamepads do not support XInput they do not work with MG DX. In a DesktopGL (cross platform desktop) project MonoGame uses SDL for handling input. SDL can use DirectInput as well and has mappings for dualshock controllers so that should work.
We could look into supporting DirectInput with the mappings from SDL in DX projects as a fallback.
We could read just the windows part of the mapping file. I’m already messing around with SharpDX because we’re updating it, so I could dig into this. And I have a dualshock controller to test with With DirectInput I think we could also support the Joystick API on WinDX.
Hmm interesting! I’m not near my office to prove this but I’m 99% certain that this IS a desktopGL project and it’s still not working with PS4 pads. If you have a spare few minutes at any point could you maybe quickly whack up a test project for your PS4 pad? If it’s supposed to be working with desktopGL then we may of found a bug
I formatted a few weeks ago so I’m on mono3.6 now.
Can you detect the controller? I.e. is GamePadState.IsConnected true?
I did some testing with my Dualshock 3, I think it should work identical to Dualshock 4 (I don’t have one to test). Things are pretty much as expected:
- You can detect the controller as a joystick (not a gamepad) with DirectInput.
- Because SDL has a mapping for the controller it can use DirectInput and the mapping to support it. That means MonoGame DesktopGL will support the controller too.
- You cannot detect the controller with XInput unless you have ScpServer installed and running.
- You cannot detect the controller with DirectInput if you have the Scp drivers installed.
For some reason I can’t detect any input though, not even with RawInput. No idea why that is, maybe still because of Scp This seems to work for other people…
You can test with the SDL2 gamepad tool: http://generalarcade.com/gamepadtool/
If it works with that we can support it.