Skip to content

Commit ab2a7fc

Browse files
committed
Added first testing program. Uses an 8x8 grid to show gaze, and when Space is held down demonstrates the change between Activation Mode and Tentative Activation Mode.
1 parent d2bfa3d commit ab2a7fc

38 files changed

+1191
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
5+
</startup>
6+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="Interaction_Wpf_101.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:Interaction_Wpf_101"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Windows;
2+
using Tobii.Interaction;
3+
using Tobii.Interaction.Wpf;
4+
5+
namespace Interaction_Wpf_101
6+
{
7+
public partial class App : Application
8+
{
9+
private Host _host;
10+
private WpfInteractorAgent _agent;
11+
12+
protected override void OnStartup(StartupEventArgs e)
13+
{
14+
// Everything starts with initializing Host, which manages connection to the
15+
// Tobii Engine and provides all Tobii Core SDK functionality.
16+
// NOTE: Make sure that Tobii.EyeX.exe is running
17+
_host = new Host();
18+
19+
// We need to instantiate InteractorAgent so it could control lifetime of the interactors.
20+
_agent = _host.InitializeWpfAgent();
21+
}
22+
23+
protected override void OnExit(ExitEventArgs e)
24+
{
25+
// we will close the coonection to the Tobii Engine before exit.
26+
_host.DisableConnection();
27+
28+
base.OnExit(e);
29+
}
30+
31+
public Host Host
32+
{
33+
get { return _host; }
34+
}
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{5360C51A-2FFB-4F9A-8948-3B20440469DB}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Interaction_Wpf_Extended</RootNamespace>
11+
<AssemblyName>Interaction_Wpf_Extended</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
15+
<WarningLevel>4</WarningLevel>
16+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
17+
<NuGetPackageImportStamp>
18+
</NuGetPackageImportStamp>
19+
<TargetFrameworkProfile />
20+
</PropertyGroup>
21+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
22+
<PlatformTarget>AnyCPU</PlatformTarget>
23+
<DebugSymbols>true</DebugSymbols>
24+
<DebugType>full</DebugType>
25+
<Optimize>false</Optimize>
26+
<OutputPath>bin\Debug\</OutputPath>
27+
<DefineConstants>DEBUG;TRACE</DefineConstants>
28+
<ErrorReport>prompt</ErrorReport>
29+
<WarningLevel>4</WarningLevel>
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32+
<PlatformTarget>AnyCPU</PlatformTarget>
33+
<DebugType>pdbonly</DebugType>
34+
<Optimize>true</Optimize>
35+
<OutputPath>bin\Release\</OutputPath>
36+
<DefineConstants>TRACE</DefineConstants>
37+
<ErrorReport>prompt</ErrorReport>
38+
<WarningLevel>4</WarningLevel>
39+
</PropertyGroup>
40+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
41+
<DebugSymbols>true</DebugSymbols>
42+
<OutputPath>bin\x86\Debug\</OutputPath>
43+
<DefineConstants>DEBUG;TRACE</DefineConstants>
44+
<DebugType>full</DebugType>
45+
<PlatformTarget>x86</PlatformTarget>
46+
<ErrorReport>prompt</ErrorReport>
47+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
48+
<Prefer32Bit>true</Prefer32Bit>
49+
</PropertyGroup>
50+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
51+
<OutputPath>bin\x86\Release\</OutputPath>
52+
<DefineConstants>TRACE</DefineConstants>
53+
<Optimize>true</Optimize>
54+
<DebugType>pdbonly</DebugType>
55+
<PlatformTarget>x86</PlatformTarget>
56+
<ErrorReport>prompt</ErrorReport>
57+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
58+
<Prefer32Bit>true</Prefer32Bit>
59+
</PropertyGroup>
60+
<ItemGroup>
61+
<Reference Include="System" />
62+
<Reference Include="System.Data" />
63+
<Reference Include="System.Xml" />
64+
<Reference Include="Microsoft.CSharp" />
65+
<Reference Include="System.Core" />
66+
<Reference Include="System.Xml.Linq" />
67+
<Reference Include="System.Data.DataSetExtensions" />
68+
<Reference Include="System.Net.Http" />
69+
<Reference Include="System.Xaml">
70+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
71+
</Reference>
72+
<Reference Include="Tobii.Interaction.Model, Version=0.7.3.333, Culture=neutral, PublicKeyToken=70326046dcdce6cb, processorArchitecture=MSIL">
73+
<HintPath>..\..\packages\Tobii.Interaction.0.7.3\lib\net45\Tobii.Interaction.Model.dll</HintPath>
74+
</Reference>
75+
<Reference Include="Tobii.Interaction.Net, Version=0.7.3.333, Culture=neutral, PublicKeyToken=70326046dcdce6cb, processorArchitecture=MSIL">
76+
<HintPath>..\..\packages\Tobii.Interaction.0.7.3\lib\net45\Tobii.Interaction.Net.dll</HintPath>
77+
</Reference>
78+
<Reference Include="WindowsBase" />
79+
<Reference Include="PresentationCore" />
80+
<Reference Include="PresentationFramework" />
81+
</ItemGroup>
82+
<ItemGroup>
83+
<ApplicationDefinition Include="App.xaml">
84+
<Generator>MSBuild:Compile</Generator>
85+
</ApplicationDefinition>
86+
<Page Include="MainWindow.xaml">
87+
<Generator>MSBuild:Compile</Generator>
88+
<SubType>Designer</SubType>
89+
</Page>
90+
<Compile Include="App.xaml.cs">
91+
<DependentUpon>App.xaml</DependentUpon>
92+
<SubType>Code</SubType>
93+
</Compile>
94+
<Compile Include="MainWindow.xaml.cs">
95+
<DependentUpon>MainWindow.xaml</DependentUpon>
96+
<SubType>Code</SubType>
97+
</Compile>
98+
</ItemGroup>
99+
<ItemGroup>
100+
<Compile Include="Properties\AssemblyInfo.cs">
101+
<SubType>Code</SubType>
102+
</Compile>
103+
<Compile Include="Properties\Resources.Designer.cs">
104+
<AutoGen>True</AutoGen>
105+
<DesignTime>True</DesignTime>
106+
<DependentUpon>Resources.resx</DependentUpon>
107+
</Compile>
108+
<Compile Include="Properties\Settings.Designer.cs">
109+
<AutoGen>True</AutoGen>
110+
<DependentUpon>Settings.settings</DependentUpon>
111+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
112+
</Compile>
113+
<EmbeddedResource Include="Properties\Resources.resx">
114+
<Generator>ResXFileCodeGenerator</Generator>
115+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
116+
</EmbeddedResource>
117+
<None Include="packages.config" />
118+
<None Include="Properties\Settings.settings">
119+
<Generator>SettingsSingleFileGenerator</Generator>
120+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
121+
</None>
122+
<AppDesigner Include="Properties\" />
123+
<None Include="readme.md" />
124+
</ItemGroup>
125+
<ItemGroup>
126+
<None Include="App.config" />
127+
</ItemGroup>
128+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
129+
<Import Project="..\..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets" Condition="Exists('..\..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets')" />
130+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
131+
<PropertyGroup>
132+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
133+
</PropertyGroup>
134+
<Error Condition="!Exists('..\..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets'))" />
135+
</Target>
136+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
137+
Other similar extension points exist, see Microsoft.Common.targets.
138+
<Target Name="BeforeBuild">
139+
</Target>
140+
<Target Name="AfterBuild">
141+
</Target>
142+
-->
143+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27004.2009
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interaction_Wpf_Extended", "Interaction_Wpf_Extended.csproj", "{5360C51A-2FFB-4F9A-8948-3B20440469DB}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Debug|x86 = Debug|x86
12+
Release|Any CPU = Release|Any CPU
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{5360C51A-2FFB-4F9A-8948-3B20440469DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{5360C51A-2FFB-4F9A-8948-3B20440469DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{5360C51A-2FFB-4F9A-8948-3B20440469DB}.Debug|x86.ActiveCfg = Debug|x86
19+
{5360C51A-2FFB-4F9A-8948-3B20440469DB}.Debug|x86.Build.0 = Debug|x86
20+
{5360C51A-2FFB-4F9A-8948-3B20440469DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{5360C51A-2FFB-4F9A-8948-3B20440469DB}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{5360C51A-2FFB-4F9A-8948-3B20440469DB}.Release|x86.ActiveCfg = Release|x86
23+
{5360C51A-2FFB-4F9A-8948-3B20440469DB}.Release|x86.Build.0 = Release|x86
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {A96F2609-F2AA-4DC4-AED8-BC6FA6B27B60}
30+
EndGlobalSection
31+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<Window x:Class="Interaction_Wpf_101.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:wpf="clr-namespace:Tobii.Interaction.Wpf;assembly=Tobii.Interaction.Net"
7+
mc:Ignorable="d"
8+
Title="8X8 Eye Tracking Grid"
9+
WindowStartupLocation="CenterScreen"
10+
MaxWidth="640" Width="640"
11+
MaxHeight="640" Height="640"
12+
PreviewKeyDown="MainWindow_OnPreviewKeyDown"
13+
PreviewKeyUp="MainWindow_OnPreviewKeyUp">
14+
<Window.Resources>
15+
<ResourceDictionary>
16+
<Style x:Key="RectangleWithGazeAwareAnimation" TargetType="Rectangle">
17+
<Setter Property="Fill" Value="LightSkyBlue" />
18+
<Setter Property="Margin" Value="5" />
19+
<Setter Property="wpf:Behaviors.IsActivatable" Value="True"></Setter>
20+
<Setter Property="wpf:Behaviors.IsTentativeFocusEnabled" Value="True"></Setter>
21+
<Style.Triggers>
22+
<Trigger Property="wpf:Behaviors.HasTentativeActivationFocus" Value="True">
23+
<Trigger.EnterActions>
24+
<BeginStoryboard>
25+
<Storyboard>
26+
<ColorAnimation Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)"
27+
From="LightSkyBlue" To="DeepSkyBlue" Duration="0:0:.2" />
28+
</Storyboard>
29+
</BeginStoryboard>
30+
</Trigger.EnterActions>
31+
<Trigger.ExitActions>
32+
<BeginStoryboard>
33+
<Storyboard>
34+
<ColorAnimation Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)"
35+
From="DeepSkyBlue" To="LightSkyBlue" Duration="0:0:.2" />
36+
</Storyboard>
37+
</BeginStoryboard>
38+
</Trigger.ExitActions>
39+
</Trigger>
40+
41+
<Trigger Property="wpf:Behaviors.HasActivationFocus" Value="True">
42+
<Trigger.EnterActions>
43+
<BeginStoryboard>
44+
<Storyboard>
45+
<ColorAnimation Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)"
46+
From="LightSkyBlue" To="DarkSeaGreen" Duration="0:0:.2" />
47+
</Storyboard>
48+
</BeginStoryboard>
49+
</Trigger.EnterActions>
50+
<Trigger.ExitActions>
51+
<BeginStoryboard>
52+
<Storyboard>
53+
<ColorAnimation Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)"
54+
From="DarkSeaGreen" To="LightSkyBlue" Duration="0:0:.2" />
55+
</Storyboard>
56+
</BeginStoryboard>
57+
</Trigger.ExitActions>
58+
</Trigger>
59+
60+
</Style.Triggers>
61+
62+
</Style>
63+
</ResourceDictionary>
64+
</Window.Resources>
65+
66+
67+
68+
<UniformGrid Columns="8" Rows="8"
69+
wpf:Behaviors.Activated="Grid_OnActivated">
70+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
71+
<StackPanel Orientation="Horizontal">
72+
<TextBlock Text="Number: " />
73+
<TextBlock x:Name="NumberOfActivations" Text="0" />
74+
</StackPanel>
75+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
76+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
77+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
78+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
79+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
80+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
81+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
82+
83+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
84+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
85+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
86+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
87+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
88+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
89+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
90+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
91+
92+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
93+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
94+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
95+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
96+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
97+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
98+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
99+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
100+
101+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
102+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
103+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
104+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
105+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
106+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
107+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
108+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
109+
110+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
111+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
112+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
113+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
114+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
115+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
116+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
117+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
118+
119+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
120+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
121+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
122+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
123+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
124+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
125+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
126+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
127+
128+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
129+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
130+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
131+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
132+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
133+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
134+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
135+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
136+
137+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
138+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
139+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
140+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
141+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
142+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
143+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
144+
<Rectangle Style="{StaticResource RectangleWithGazeAwareAnimation}" />
145+
</UniformGrid>
146+
</Window>

0 commit comments

Comments
 (0)