4

I want to connect a PS3 Controller to my computer (using a usb cable) and use it to control something (like a game). Using c# (or c/c++)

Can someone point me into the right direction (perhaps a tutorial)? Is there a good library that I can use?

I don't need any of the fancy things like vibration; just the buttons will do.

csharpwinphonexaml
  • 3,659
  • 10
  • 32
  • 63
user2839747
  • 255
  • 4
  • 11
  • Why reinvent the [wheel](http://www.gamefront.com/how-to-use-a-ps3-controller-on-a-pc/)? – Brian Nov 14 '13 at 19:43
  • I think he wants to use the controller for his own reasons. [Here is a link to an explanation](http://stackoverflow.com/questions/3929764/taking-input-from-a-joystick-with-c-sharp-net/5248304#5248304) – Ilan Nov 14 '13 at 19:48
  • what exactly are you trying to achieve? – RoughPlace Apr 28 '14 at 11:14

2 Answers2

1

This should be the right starting point for you:

An article on using the USB Human Interface Device api for reading a wired PS3 controller including motion.

http://www.codeproject.com/Articles/23634/Wired-PS-Six-Axis-Controller-Using-USB-HID-as-Inp

0

If you just want buttons, I personally recommend SFML, which has a solid C# binding. This may, however, lock you into using an SFML Window, or at least an OpenGL one which you then pass into SFML. SFML is also open source if you want to look into how they do it from C++.

If you plan on learning MonoGame/XNA, you should look at how to receive input via the SDL library, as this is what underlies MonoGame for a number of uses including input.

David
  • 10,458
  • 1
  • 28
  • 40