Beispiel #1
0
        void Proc()
        {
            var reader = new StreamReader(client);
            var writer = new StreamWriter(client);

            while (IsStarted)
            {
                var read = reader.ReadLine();

                var spl = read.Split('|');
                switch (spl[0])
                {
                case "released":
                    Released?.Invoke(this, ApiSerializer.Released(spl[1]));
                    break;

                case "tracked":
                    GazeTracked?.Invoke(this, ApiSerializer.Tracked(spl[1]));
                    break;

                case "clicked":
                    Clicked?.Invoke(this, ApiSerializer.Clicked(spl[1]));
                    break;

                default:
                    throw new NotImplementedException("Unknown mode");
                }

                Thread.Sleep(1);
            }

            reader.Dispose();
            writer.Dispose();
        }
Beispiel #2
0
 void Cursor_Clicked(object sender, Point e)
 {
     AddMessage("clicked|" + ApiSerializer.Clicked(e));
 }
Beispiel #3
0
 void Cursor_GazeTracked(object sender, GazeEventArgs e)
 {
     AddMessage("tracked|" + ApiSerializer.Tracked(new ApiSerializer.GazeEventArgs(e.Position, e.ScreenProperties, e.IsFaceDetected, e.IsGazeDetected)));
 }
Beispiel #4
0
 void Cursor_Released(object sender, CursorReleasedArgs e)
 {
     AddMessage("released|" + ApiSerializer.Released(new ApiSerializer.CursorReleasedArgs(e.StartPosition, e.EndPosition, e.Duration)));
 }