I've created a UWA on Windows 10 in C#, using Visual Studio 2015 using the Windows.Gaming.Input headset class to try to recognize when a headset is disconnect/connected to the Xbox One controller through the 3.5mm port headphone jack on the controller. I've checked the device manager and see that the headset is recognized on the controller, but my code doesn't show anything connected or disconnected.
public sealed class Headset
Windows Gaming Input MSDN
there isn't much documentation on the new Windows.Gaming.Input for universal windows apps,
foreach (Gamepad gamepad in Gamepad.Gamepads)
{
gamepad.HeadsetConnected += Gamepad_HeadsetConnected;
gamepad.HeadsetDisconnected += Gamepad_HeadsetDisconnected;
}
private void Gamepad_HeadsetDisconnected(IGameController sender, Headset args)
{
HeadsetConnection = "Headset Disconnected";
}
private void Gamepad_HeadsetConnected(IGameController sender, Headset args)
{
HeadsetConnection = "Headset Connected";
}