I'm trying to build a Windows game without the now sunset XNA or DirectX, but I'm having difficulty figuring out how to create controller support (mostly just XBox controllers). Is there anything in the standard C# libraries? If at all possible, I want to avoid using any external libraries or anything.
Asked
Active
Viewed 547 times
0
-
You could use SlimDx, it has support for XInput, which would be what you are looking for. – Apr 16 '15 at 19:19
-
I would suggest looking at SharpDX which is actively maintained and just had a new version coming out – thumbmunkeys Apr 16 '15 at 19:20
-
I believe monogame supports Xbox 360 controllers. – AaronLS Apr 16 '15 at 20:51
-
If you were using Linux this would be an option: https://github.com/nahueltaibo/gamepad – krowe Jan 20 '21 at 18:05
-
If you are willing to target Win10+ you can use Windows.Gaming: https://www.youtube.com/watch?v=3N0d6ZMNvOY – krowe Jan 20 '21 at 18:12
1 Answers
2
No, without using XInput DLLs, you cannot access/work with XBox 360 controllers. You can either PInvoke XInput dlls directly or work with it through SlimDX (as suggested in the comments).
AFAIK, XInput has not been deprecated. You can use XInput on Windows 8 with Store apps and I believe I've seen this DLL even on the Windows 10 preview.

Ani
- 10,826
- 3
- 27
- 46