0

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";
    }
amiedd
  • 9
  • 6
  • Hello sir! Well I am also trying to get this to work. Do you know , if this works only with Xbox One controllers? Because I am trying to make this work with an Xbox 360 controller and Gamepad.Gamepads is not populated or it does not fire the GamepadAdded event. Wierd. – Mihail Georgescu Dec 02 '15 at 19:22
  • I believe the gaming.input works with the Xbox 360 controller, i used xinput for my 360 controller code though. – amiedd Dec 11 '15 at 18:52

0 Answers0