Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sample code to get the DeviceInfo for a XBoxOne Controller
using System.Linq;
using DeviceManagement;
namespace ConsoleApplication2
class DeviceInspection
public DeviceInfo GetXBoxController()
// you need nuget pkg
// ClassName: "XB1UsbClass"
// Desc: "Microsoft Xbox One Controller"
var allClasses = DeviceInfoSet.GetAllClassesPresent();
var devices = allClasses.GetDevices();
return (from device in devices
where device.ClassName == "XB1UsbClass"
select device).FirstOrDefault();

This comment has been minimized.

Copy link

AndromedaStrain commented Aug 6, 2016

This might be a completely dumb question, but is DeviceManagement defined somewhere? I want to experiment with the Xbox One controller as input to some of my windows forms applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.