5

I'm currently trying to use my Xbox 360 controller in my WPF application but all the tutorials online refer to using XNA in a game environment. I was just wondering if there is an easy to get my application to detect my Xbox 360 controller and any movement/button pushes that may come from it. My current setup is visual studio 2010, .NET 4.0, WPf, C#, and I have the xbox 360 wireless adapter for the PC. Thanks!

Oskar Kjellin
  • 21,280
  • 10
  • 54
  • 93
Petezah
  • 1,465
  • 4
  • 26
  • 30

1 Answers1

5

Consider [Bruno Silva's solution for integrating the Xbox 360 gamepad with PowerPoint][x]. The first project was for an Office Add-in for Powerpoint, but the base project is a wrapper to allow the gamepad to be used within a Windows or WPF application.

It wraps XNA Microsoft.Xna.Framework.Input.GamePad class and provides an interface with events associated with each button status change, as well as on game pad connect/disconnect.

[Bruno Silva's blog has links to the project and sample code][x].

You'll need to have XNA Framework 2.0 installed. I'm unsure if higher/recent versions are compatible.

p.campbell
  • 98,673
  • 67
  • 256
  • 322
  • 1
    Is there an update on this answer? Have any newer add-ons for VisualStudio emerged or is this still the only way of getting this done? Also, what's the website mentioned in the answer? – Darth Coder Aug 31 '15 at 23:05