Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the Xbox 360 Controller in a WPF application

Tags:

c#

wpf

xbox360

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!

like image 945
Petezah Avatar asked Jul 27 '10 22:07

Petezah


1 Answers

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.

like image 179
p.campbell Avatar answered Sep 23 '22 15:09

p.campbell