5

I'm working on a simple point-and-click game for young children. Because some children have a physical limitation I would like to give them the possibility to use a joystick as an alternative input device.

Can anyone give me some advice, tips or some sample C# (or even VB.net) code on how to implement this?

I would rather not use something from DirectX as I think this would be overkill for this type of game.

Thanks!

Update:

I read most of the information on the given links. I tried to get DirectInput into VS 2010, but I get an error about a reference that cannot be found. I searched the net for a solution, but on many places I read that DirectX is obsolete and I should use XNA. But all information I find about XNA is about Windows Phone and XBox. On the Microsoft XNA Developer Center they say that if you want to develop for Windows you have to use DirectX and that brings me back to square one!

Can somebody help me back on track? I only want to use a joystick in my Windows WPF application and I'm using VS 2010 C#. Thanks.

Jackerd
  • 53
  • 2
  • 7

2 Answers2

3

Using the DirectInput library, you can read input from a Joystick. You do not have to use DirectX to render the output, you are just using the input.

Some handy links:

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
GvS
  • 52,015
  • 16
  • 101
  • 139
0

I don't know a bunch about this but in the few instances where I have attached these devices to a PC the driver for the device allows you to map keys to the inputs on the device.

So you would just allow your app to take keyboard inputs to move the cursor etc. and map the relevant keys to the directions etc. on the joystick.

One Monkey
  • 713
  • 3
  • 9
  • 24