예제 #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         _lowPassFilterTimer.Start();
         _lowPassFilterTimer.Dispose();
         XboxController.StopPolling();
     }
 }
예제 #2
0
        public void Shutdown()
        {
            Log.WriteLine("Shutting down XInput controllers...");
            XboxController.StopPolling();
            _active = false;

            foreach (var c in Controllers)
            {
                c.Stop();
            }
        }
예제 #3
0
 public static void Stop()
 {
     if (_watcherThread == null)
     {
         return;
     }
     Logger.Write("Stopping controller manager");
     _watcherThread.Abort();
     _watcherThread = null;
     foreach (var controller in _allControllers)
     {
         controller?.Stop();
     }
     _allControllers.Clear();
     XboxController.StopPolling();
     DS4Devices.stopControllers();
 }
예제 #4
0
        internal void InitializeController()
        {
            XboxController.StopPolling();

            try
            {
                _controller = XboxController.RetrieveController(_currid);
                _controller.StateChanged += _selectedController_StateChanged;
                XboxController.StartPolling();

                _message = "Connected to controller #" + _currid;
            }
            catch
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Cannot find controller with ID #" + _currid);
                _controller = null;

                _message = "Cannot find controller with ID #" + _currid;
            }
        }
예제 #5
0
 protected override void OnClosing(CancelEventArgs e)
 {
     XboxController.StopPolling();
     base.OnClosing(e);
 }
예제 #6
0
 private void StopPolling()
 {
     _controller.StateChanged -= StateChanged;
     XboxController.StopPolling();
 }
예제 #7
0
 public void Stop()
 {
     XboxController.StopPolling();
 }