コード例 #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            // you need nuget pkg https://devicemgr.codeplex.com/
            // ClassName: "XB1UsbClass"
            // Desc: "Microsoft Xbox One Controller"
            var allClasses = DeviceInfoSet.GetAllClassesPresent();
            var devices    = allClasses.GetDevices();

            controllerDevice = (from device in devices where device.ClassName == "XB1UsbClass" select device).FirstOrDefault();
        }
コード例 #2
0
        public Form1()
        {
            InitializeComponent();
            mjpeg             = new MjpegDecoder();
            mjpeg.FrameReady += mjpeg_FrameReady;
            // GoFullscreen(true);
            var allClasses = DeviceInfoSet.GetAllClassesPresent();
            var devices    = allClasses.GetDevices();

            xbox  = (from device in devices where device.ClassName == "XboxComposite" select device).FirstOrDefault();
            timer = new DispatcherTimer {
                Interval = TimeSpan.FromMilliseconds(100)
            };
            timer.Tick += timerTick;
            timer.Start();
        }