Home Forums Game Integration Tobii.EyeX.Framework Issue Reply To: Tobii.EyeX.Framework Issue

#7198
Fjorda
Participant

So I need Tobii.EyeXFramework for making a new calibration every time I open my game, with this code:

var host = new EyeXFramework.EyeXHost();
host.Start();
await Task.Delay(500);
host.LaunchGuestCalibration();

I also need EyeXFramework to include this code:

namespace MinimalFixationDataStream
{
using EyeXFramework;
using System;
using Tobii.EyeX.Framework;

public static class Program
{
public static void Main(string[] args)
{
double lastFixationStartTime = 0;

using (var eyeXHost = new EyeXHost())
{
eyeXHost.Start();

// Create a data stream: lightly filtered gaze point data.
// Other choices of data streams include EyePositionDataStream and FixationDataStream.
using (var fixationGazeDataStream = eyeXHost.CreateFixationDataStream(FixationDataMode.Sensitive))
{
// Write the data to the console.
fixationGazeDataStream.Next += (s, e) =>
{
if (e.EventType == FixationDataEventType.Begin)
{
lastFixationStartTime = e.Timestamp;
}
if (e.EventType == FixationDataEventType.End)
{
var lastFixationDuration = e.Timestamp – lastFixationStartTime;
Console.WriteLine(“Last fixation duration: {0:0} milliseconds”, lastFixationDuration);
}
};

// Let it run until a key is pressed.
Console.WriteLine(“Listening for fixation data, press any key to exit…”);
Console.In.Read();
}
}
}
}
}