Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controller support for Xbox one in Windows UWP

I am wondering how I am supposed to handle input for UWP apps targeting Xbox One. I have noticed DirectInput, but I see two issues with it for my use cases:

  1. From MSDN, it only seems to support Xbox 360 controllers

    XInput is an API that allows applications to receive input from the Xbox 360 Controller for Windows. Controller rumble effects and voice input and output are supported.

  2. DirectX and all of its API's (Direct2d, Direct3D, Xinput, etc...) are only supported on C / C++. That means even if Xinput supported Xbox one controllers, I could not use C# or JavaScript to develop truly universal apps.

What options do I have (at least as far as C# is concerned) for supporting Xbox One controller support on a Windows UWP app?

like image 443
James Parsons Avatar asked Aug 13 '15 00:08

James Parsons


1 Answers

Take a look at the Windows.Gaming.Input namespace. Its GamePad class is in the Universal API contract and available on all device families and languages.

like image 97
Rob Caplan - MSFT Avatar answered Sep 16 '22 17:09

Rob Caplan - MSFT