/// <summary> /// Start gaze watcher and declare watcher event handlers. /// </summary> private void StartGazeDeviceWatcher() { if (gazeDeviceWatcher == null) { gazeDeviceWatcher = GazeInputSourcePreview.CreateWatcher(); gazeDeviceWatcher.Added += this.DeviceAdded; gazeDeviceWatcher.Updated += this.DeviceUpdated; gazeDeviceWatcher.Start(); } }
private GazePointer() { NonInvokeGazeTargetItem = new NonInvokeGazeTargetItem(); // Default to not filtering sample data Filter = new NullFilter(); _gazeCursor = new GazeCursor(); // timer that gets called back if there gaze samples haven't been received in a while _eyesOffTimer = new DispatcherTimer(); _eyesOffTimer.Tick += OnEyesOff; // provide a default of GAZE_IDLE_TIME microseconds to fire eyes off EyesOffDelay = GAZE_IDLE_TIME; InitializeHistogram(); _devices = new List <GazeDevicePreview>(); _watcher = GazeInputSourcePreview.CreateWatcher(); _watcher.Added += OnDeviceAdded; _watcher.Removed += OnDeviceRemoved; _watcher.Start(); }