Taking input from a joystick with C# .NET

前端 未结 4 1495
-上瘾入骨i
-上瘾入骨i 2020-12-01 04:16

I searched around on Google for this, but the only things I came up with were outdated and did not work.

Does anyone have any information on how to get joystick data

4条回答
  •  生来不讨喜
    2020-12-01 04:37

    The bad news is that Microsoft seems to stop supporting their NET libraries for DirectX and focus on XNA instead. I don't work in GameDev so I don't need to use XNA but you may try it if you developing computer games. The good news is that there are other approaches. One is SlimDX the new framework to help you to wok with DirectX from C#. The other way is to directly add references of "Microsoft.DirectX.dll" and "Microsoft.DirectX.DirectInput.dll" to your project. you can find them "..\Windows\Microsoft.NET\DirectX for Managed Code\". if you you are going to use last approach here is a link to codeproject where you can read how to work with a joystick.

    EDIT: If your application is based on NET version newer then 2.0 the application may hang on. To fix this problem change config file and add this:

     
    

提交回复
热议问题