Xbox One Wireless Controller can work with your PC if you download one of the following driver packages:
Note To use your Xbox One controller with your console after using it with a PC, you must re-sync the controller to the console. You can do this by using the wireless sync button or a USB cable. For details, see Connect a wireless Xbox One controller to your console.
If you want to use an Xbox 360 Controller with your computer, you can use an Xbox 360 Controller for Windows. Or, you can use an Xbox 360 Wireless Controller together with an Xbox 360 Wireless Gaming Receiver for Windows.
Getting to Grips with the API
The main method of work with a gamepad in Windows is to use the C ++ API XInput . http://msdn.microsoft.com/en-us/library/windows/desktop/ee417001(v=vs.85).aspx Noteworthy is the absence of initialization functions, you simply query the state of the controller:
XInputGetState function takes as parameters the index controller (they can be connected to more than one) as well as with the state of the structure where the return value of buttons:
Buttons coded bits:
Slightly more complicated is the values of the hammers and two joysticks. The values of X, Y, are within SHRT_MIN-SHRT_MAX (-32768 +32767), and for the hammers _UI8_MAX (255). Usually in games, these values are normalized to -1.0 +1.0. Also for joystick should consider the so-called dead zone. Return values axes at the neutral position can vary from zero, and to disregard them use the default values of "dead zones", which should be computed by the following algorithm:
Typical values of these thresholds are as follows:
You can look at more detailed examples of work with a gamepad online http://code.msdn.com as well as take advantage of the wrapper which is part of DirectX Toolkit .
XInput game controller sample
This sample demonstrates the use of the XInput APIs in a C++ app.
Download C++ (61.0 KB)
http://msdn.microsoft.com/en-us/library/bb648761.aspx XInput Controller Sample
In addition to the functions directly related to the status polling controller to XInput also includes management features vibrating motor and is connected accessory, such as a voice recorder with a headset or audio to the headset. Support also has a joystick for managed code in the library and XNA Monogame .
Get in touch?
So if your building a game or have built a game for Windows 8 with Controller support please get in touch as I would love to share your experience!