public TobiiCoordinatesProvider(Action <TobiiCoordinates> on_coordinates_callback) { this.on_coordinates_callback = on_coordinates_callback; try { host = new Tobii.Interaction.Host(); gaze_point_data_stream = host.Streams.CreateGazePointDataStream(); eye_position_stream = host.Streams.CreateEyePositionStream(); head_pose_stream = host.Streams.CreateHeadPoseStream(); UpdateTobiiStreams(null, null); Options.CalibrationMode.Changed += UpdateTobiiStreams; gaze_point_data_stream.GazePoint(OnGazePoint); eye_position_stream.EyePosition(OnEyePosition); head_pose_stream.HeadPose(OnHeadPose); } catch (Exception e) { if (MessageBox.Show("Eye Tracker isn't installed properly. \n\n" + "Open Tobii software download page? \n", "Failed Connecting to Tobii Eye Tracker", MessageBoxButtons.YesNo) == DialogResult.Yes) { Process.Start("https://gaming.tobii.com/getstarted/"); } } }
public EyeTrackingMouse() { try { host = new Tobii.Interaction.Host(); gaze_point_data_stream = host.Streams.CreateGazePointDataStream(); eye_position_stream = host.Streams.CreateEyePositionStream(); head_pose_stream = host.Streams.CreateHeadPoseStream(); UpdateTobiiStreams(null, null); Settings.CalibrationModeChanged += UpdateTobiiStreams; gaze_point_data_stream.GazePoint(OnGazePoint); eye_position_stream.EyePosition(OnEyePosition); head_pose_stream.HeadPose(OnHeadPose); } catch (Exception e) { MessageBox.Show(e.Message + ". Try reinstalling driver for Tobii Eye Tracker 4C."); Environment.Exit(0); } }