diff --git a/.vsts-ci.yml b/.vsts-ci.yml
index ba627db415a..47893c4691c 100644
--- a/.vsts-ci.yml
+++ b/.vsts-ci.yml
@@ -4,7 +4,7 @@ variables:
steps:
- task: BatchScript@1
inputs:
- filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\Preview\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
+ filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\VsDevCmd.bat"
arguments: -no_logo
modifyEnvironment: true
displayName: Setup Environment Variables
diff --git a/GazeInputTest/App.xaml b/GazeInputTest/App.xaml
new file mode 100644
index 00000000000..760dafe33dc
--- /dev/null
+++ b/GazeInputTest/App.xaml
@@ -0,0 +1,8 @@
+
+
+
diff --git a/GazeInputTest/App.xaml.cs b/GazeInputTest/App.xaml.cs
new file mode 100644
index 00000000000..7aba0f3c809
--- /dev/null
+++ b/GazeInputTest/App.xaml.cs
@@ -0,0 +1,102 @@
+// ******************************************************************
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
+// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
+// ******************************************************************
+
+using System;
+using Windows.ApplicationModel;
+using Windows.ApplicationModel.Activation;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Navigation;
+
+namespace GazeInputTest
+{
+ ///
+ /// Provides application-specific behavior to supplement the default Application class.
+ ///
+ sealed partial class App : Application
+ {
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public App()
+ {
+ this.InitializeComponent();
+ this.Suspending += OnSuspending;
+ }
+
+ ///
+ /// Invoked when the application is launched normally by the end user. Other entry points
+ /// will be used such as when the application is launched to open a specific file.
+ ///
+ /// Details about the launch request and process.
+ protected override void OnLaunched(LaunchActivatedEventArgs e)
+ {
+ Frame rootFrame = Window.Current.Content as Frame;
+
+ // Do not repeat app initialization when the Window already has content,
+ // just ensure that the window is active
+ if (rootFrame == null)
+ {
+ // Create a Frame to act as the navigation context and navigate to the first page
+ rootFrame = new Frame();
+
+ rootFrame.NavigationFailed += OnNavigationFailed;
+
+ if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
+ {
+ //TODO: Load state from previously suspended application
+ }
+
+ // Place the frame in the current Window
+ Window.Current.Content = rootFrame;
+ }
+
+ if (e.PrelaunchActivated == false)
+ {
+ if (rootFrame.Content == null)
+ {
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ rootFrame.Navigate(typeof(MainPage), e.Arguments);
+ }
+ // Ensure the current window is active
+ Window.Current.Activate();
+ }
+ }
+
+ ///
+ /// Invoked when Navigation to a certain page fails
+ ///
+ /// The Frame which failed navigation
+ /// Details about the navigation failure
+ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
+ }
+
+ ///
+ /// Invoked when application execution is being suspended. Application state is saved
+ /// without knowing whether the application will be terminated or resumed with the contents
+ /// of memory still intact.
+ ///
+ /// The source of the suspend request.
+ /// Details about the suspend request.
+ private void OnSuspending(object sender, SuspendingEventArgs e)
+ {
+ var deferral = e.SuspendingOperation.GetDeferral();
+ //TODO: Save application state and stop any background activity
+ deferral.Complete();
+ }
+ }
+}
diff --git a/GazeInputTest/Assets/LockScreenLogo.scale-200.png b/GazeInputTest/Assets/LockScreenLogo.scale-200.png
new file mode 100644
index 00000000000..735f57adb5d
Binary files /dev/null and b/GazeInputTest/Assets/LockScreenLogo.scale-200.png differ
diff --git a/GazeInputTest/Assets/SplashScreen.scale-200.png b/GazeInputTest/Assets/SplashScreen.scale-200.png
new file mode 100644
index 00000000000..023e7f1feda
Binary files /dev/null and b/GazeInputTest/Assets/SplashScreen.scale-200.png differ
diff --git a/GazeInputTest/Assets/Square150x150Logo.scale-200.png b/GazeInputTest/Assets/Square150x150Logo.scale-200.png
new file mode 100644
index 00000000000..af49fec1a54
Binary files /dev/null and b/GazeInputTest/Assets/Square150x150Logo.scale-200.png differ
diff --git a/GazeInputTest/Assets/Square44x44Logo.scale-200.png b/GazeInputTest/Assets/Square44x44Logo.scale-200.png
new file mode 100644
index 00000000000..ce342a2ec8a
Binary files /dev/null and b/GazeInputTest/Assets/Square44x44Logo.scale-200.png differ
diff --git a/GazeInputTest/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/GazeInputTest/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
new file mode 100644
index 00000000000..f6c02ce97e0
Binary files /dev/null and b/GazeInputTest/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ
diff --git a/GazeInputTest/Assets/StoreLogo.png b/GazeInputTest/Assets/StoreLogo.png
new file mode 100644
index 00000000000..7385b56c0e4
Binary files /dev/null and b/GazeInputTest/Assets/StoreLogo.png differ
diff --git a/GazeInputTest/Assets/Wide310x150Logo.scale-200.png b/GazeInputTest/Assets/Wide310x150Logo.scale-200.png
new file mode 100644
index 00000000000..288995b397f
Binary files /dev/null and b/GazeInputTest/Assets/Wide310x150Logo.scale-200.png differ
diff --git a/GazeInputTest/GazeInputTest.csproj b/GazeInputTest/GazeInputTest.csproj
new file mode 100644
index 00000000000..20eee273052
--- /dev/null
+++ b/GazeInputTest/GazeInputTest.csproj
@@ -0,0 +1,151 @@
+
+
+
+
+ Debug
+ x86
+ {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}
+ AppContainerExe
+ Properties
+ GazeInputTest
+ GazeInputTest
+ en-US
+ UAP
+ 10.0.17134.0
+ 10.0.17134.0
+ 14
+ 512
+ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ true
+ GazeInputTest_TemporaryKey.pfx
+
+
+ true
+ bin\x86\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x86
+ false
+ prompt
+ true
+
+
+ bin\x86\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x86
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\ARM\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ ARM
+ false
+ prompt
+ true
+
+
+ bin\ARM\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x64
+ false
+ prompt
+ true
+
+
+ bin\x64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x64
+ false
+ prompt
+ true
+ true
+
+
+ PackageReference
+
+
+
+ App.xaml
+
+
+ MainPage.xaml
+
+
+
+
+
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+ 6.0.1
+
+
+
+
+ {a5e98964-45b1-442d-a07a-298a3221d81e}
+ Microsoft.Toolkit.Uwp.Input.GazeInteraction
+
+
+
+ 14.0
+
+
+
+
\ No newline at end of file
diff --git a/GazeInputTest/MainPage.xaml b/GazeInputTest/MainPage.xaml
new file mode 100644
index 00000000000..863a2efa955
--- /dev/null
+++ b/GazeInputTest/MainPage.xaml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show Cursor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GazeInputTest/MainPage.xaml.cs b/GazeInputTest/MainPage.xaml.cs
new file mode 100644
index 00000000000..8d5f4a6802b
--- /dev/null
+++ b/GazeInputTest/MainPage.xaml.cs
@@ -0,0 +1,83 @@
+// ******************************************************************
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
+// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
+// ******************************************************************
+
+using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
+using System;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+
+namespace GazeInputTest
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class MainPage : Page
+ {
+ public MainPage()
+ {
+ this.InitializeComponent();
+
+ ShowCursor.IsChecked = GazeInput.GetIsCursorVisible(this);
+
+ GazeInput.IsDeviceAvailableChanged += GazeInput_IsDeviceAvailableChanged;
+ GazeInput_IsDeviceAvailableChanged(null, null);
+ }
+
+ private void GazeInput_IsDeviceAvailableChanged(object sender, object e)
+ {
+ DeviceAvailable.Text = GazeInput.IsDeviceAvailable ? "Eye tracker device available" : "No eye tracker device available";
+ }
+
+ private void OnStateChanged(object sender, StateChangedEventArgs ea)
+ {
+ Dwell.Content = ea.PointerState.ToString();
+ }
+
+ private void Dwell_Click(object sender, RoutedEventArgs e)
+ {
+ Dwell.Content = "Clicked";
+ }
+
+ private void ShowCursor_Toggle(object sender, RoutedEventArgs e)
+ {
+ if (ShowCursor.IsChecked.HasValue)
+ {
+ GazeInput.SetIsCursorVisible(this, ShowCursor.IsChecked.Value);
+ }
+ }
+
+ int clickCount;
+
+ private void OnLegacyInvoked(object sender, RoutedEventArgs e)
+ {
+ clickCount++;
+ HowButton.Content = string.Format("{0}: Legacy click", clickCount);
+ }
+
+ private void OnGazeInvoked(object sender, DwellInvokedRoutedEventArgs e)
+ {
+ clickCount++;
+ HowButton.Content = string.Format("{0}: Accessible click", clickCount);
+ e.Handled = true;
+ }
+
+ private void OnInvokeProgress(object sender, DwellProgressEventArgs e)
+ {
+ if (e.State == DwellProgressState.Progressing)
+ {
+ ProgressShow.Value = 100.0 * e.Progress;
+ }
+ ProgressShow.IsIndeterminate = e.State == DwellProgressState.Complete;
+ e.Handled = true;
+ }
+ }
+}
diff --git a/GazeInputTest/Package.appxmanifest b/GazeInputTest/Package.appxmanifest
new file mode 100644
index 00000000000..232aef12182
--- /dev/null
+++ b/GazeInputTest/Package.appxmanifest
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+ GazeInputTest
+ harishsk
+ Assets\StoreLogo.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GazeInputTest/Properties/AssemblyInfo.cs b/GazeInputTest/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..08fe6b28abd
--- /dev/null
+++ b/GazeInputTest/Properties/AssemblyInfo.cs
@@ -0,0 +1,40 @@
+// ******************************************************************
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
+// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
+// ******************************************************************
+
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("GazeInputTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("GazeInputTest")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+//[assembly: AssemblyVersion("1.0.0.0")]
+//[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/GazeInputTest/Properties/Default.rd.xml b/GazeInputTest/Properties/Default.rd.xml
new file mode 100644
index 00000000000..af00722cdf9
--- /dev/null
+++ b/GazeInputTest/Properties/Default.rd.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellInvokedRoutedEventArgs.h b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellInvokedRoutedEventArgs.h
new file mode 100644
index 00000000000..7ef31be8bb5
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellInvokedRoutedEventArgs.h
@@ -0,0 +1,28 @@
+//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
+//See LICENSE in the project root for license information.
+
+#pragma once
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+///
+/// This parameter is passed to the GazeElement::Invoked event and allows
+/// the application to prevent default invocation when the user dwells on a control
+///
+public ref class DwellInvokedRoutedEventArgs : public RoutedEventArgs
+{
+public:
+
+ ///
+ /// The application should set this value to true to prevent invoking the control when the user dwells on a control
+ ///
+ property bool Handled;
+
+internal:
+
+ DwellInvokedRoutedEventArgs()
+ {
+ }
+};
+
+END_NAMESPACE_GAZE_INPUT
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressEventArgs.h b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressEventArgs.h
new file mode 100644
index 00000000000..86c5b2ef5eb
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressEventArgs.h
@@ -0,0 +1,43 @@
+//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
+//See LICENSE in the project root for license information.
+
+#pragma once
+
+#include "DwellProgressState.h"
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+///
+/// This parameter is passed to the GazeElement.DwellProgressFeedback event. The event is fired to inform the application of the user's progress towards completing dwelling on a control
+///
+public ref class DwellProgressEventArgs : public RoutedEventArgs
+{
+public:
+
+ ///
+ /// An enum that reflects the current state of dwell progress
+ ///
+ property DwellProgressState State { DwellProgressState get() { return _state; }}
+
+ ///
+ /// A value between 0 and 1 that reflects the fraction of progress towards completing dwell
+ ///
+ property double Progress { double get() { return _progress; }}
+
+ ///
+ /// A parameter for the application to set to true if it handles the event. If this parameter is set to true, the library suppresses default animation for dwell feedback on the control
+ ///
+ property bool Handled;
+
+internal:
+ DwellProgressEventArgs(DwellProgressState state, TimeSpan elapsedDuration, TimeSpan triggerDuration)
+ {
+ _state = state;
+ _progress = ((double)elapsedDuration.Duration) / triggerDuration.Duration;
+ }
+private:
+ DwellProgressState _state;
+ double _progress;
+};
+
+END_NAMESPACE_GAZE_INPUT
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressState.h b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressState.h
new file mode 100644
index 00000000000..0ff7716193d
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressState.h
@@ -0,0 +1,26 @@
+#pragma once
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+///
+/// An enum that reflects the current state of progress towards dwell when a user is focused on a control
+///
+public enum class DwellProgressState
+{
+ ///
+ /// User is not looking at the control
+ ///
+ Idle,
+
+ ///
+ /// User is continuing to focus on a control with an intent to dwell and invoke
+ ///
+ Progressing,
+
+ ///
+ /// User has completed dwelling on a control
+ ///
+ Complete
+};
+
+END_NAMESPACE_GAZE_INPUT
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeCursor.cpp b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeCursor.cpp
new file mode 100644
index 00000000000..96396ae831e
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeCursor.cpp
@@ -0,0 +1,89 @@
+//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
+//See LICENSE in the project root for license information.
+
+#include "pch.h"
+#include "GazeCursor.h"
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+GazeCursor::GazeCursor()
+{
+ _cursorRadius = DEFAULT_CURSOR_RADIUS;
+
+ _isCursorVisible = DEFAULT_CURSOR_VISIBILITY;
+
+ _gazePopup = ref new Popup();
+ _gazePopup->IsHitTestVisible = false;
+
+ _gazeCanvas = ref new Canvas();
+ _gazeCanvas->IsHitTestVisible = false;
+
+ _gazeCursor = ref new Shapes::Ellipse();
+ _gazeCursor->Fill = ref new SolidColorBrush(Colors::IndianRed);
+ _gazeCursor->VerticalAlignment = Windows::UI::Xaml::VerticalAlignment::Top;
+ _gazeCursor->HorizontalAlignment = Windows::UI::Xaml::HorizontalAlignment::Left;
+ _gazeCursor->Width = 2 * CursorRadius;
+ _gazeCursor->Height = 2 * CursorRadius;
+ _gazeCursor->IsHitTestVisible = false;
+
+ _origSignalCursor = ref new Shapes::Ellipse();
+ _origSignalCursor->Fill = ref new SolidColorBrush(Colors::Green);
+ _origSignalCursor->VerticalAlignment = Windows::UI::Xaml::VerticalAlignment::Top;
+ _origSignalCursor->HorizontalAlignment = Windows::UI::Xaml::HorizontalAlignment::Left;
+ _origSignalCursor->Width = 2 * CursorRadius;
+ _origSignalCursor->Height = 2 * CursorRadius;
+ _origSignalCursor->IsHitTestVisible = false;
+
+ _gazeRect = ref new Shapes::Rectangle();
+ _gazeRect->IsHitTestVisible = false;
+
+ _gazeCanvas->Children->Append(_gazeCursor);
+ _gazeCanvas->Children->Append(_gazeRect);
+
+ // TODO: Reenable this once GazeCursor is refactored correctly
+ //_gazeCanvas->Children->Append(_origSignalCursor);
+
+ _gazePopup->Child = _gazeCanvas;
+}
+
+void GazeCursor::CursorRadius::set(int value)
+{
+ _cursorRadius = value;
+ if (_gazeCursor != nullptr)
+ {
+ _gazeCursor->Width = 2 * _cursorRadius;
+ _gazeCursor->Height = 2 * _cursorRadius;
+ }
+}
+
+void GazeCursor::IsCursorVisible::set(bool value)
+{
+ _isCursorVisible = value;
+ if (_gazePopup != nullptr)
+ {
+ _gazePopup->IsOpen = _isCursorVisible && _isGazeEntered;
+ }
+}
+
+void GazeCursor::IsGazeEntered::set(bool value)
+{
+ _isGazeEntered = value;
+ if (_gazePopup != nullptr)
+ {
+ _gazePopup->IsOpen = _isCursorVisible && _isGazeEntered;
+ }
+}
+
+void GazeCursor::LoadSettings(ValueSet^ settings)
+{
+ if (settings->HasKey("GazeCursor.CursorRadius"))
+ {
+ CursorRadius = (int)(settings->Lookup("GazeCursor.CursorRadius"));
+ }
+ if (settings->HasKey("GazeCursor.CursorVisibility"))
+ {
+ IsCursorVisible = (bool)(settings->Lookup("GazeCursor.CursorVisibility"));
+ }
+}
+
+END_NAMESPACE_GAZE_INPUT
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeCursor.h b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeCursor.h
new file mode 100644
index 00000000000..0c427626716
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeCursor.h
@@ -0,0 +1,93 @@
+//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
+//See LICENSE in the project root for license information.
+
+#pragma once
+
+using namespace Windows::Foundation::Collections;
+using namespace Windows::UI;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::UI::Xaml::Controls::Primitives;
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+private ref class GazeCursor sealed
+{
+private:
+ const int DEFAULT_CURSOR_RADIUS = 5;
+ const bool DEFAULT_CURSOR_VISIBILITY = true;
+
+public:
+ static property GazeCursor^ Instance
+ {
+ GazeCursor^ get()
+ {
+ static GazeCursor^ cursor = ref new GazeCursor();
+ return cursor;
+ }
+ }
+
+ void LoadSettings(ValueSet^ settings);
+ property int CursorRadius
+ {
+ int get() { return _cursorRadius; }
+ void set(int value);
+ }
+
+ property bool IsCursorVisible
+ {
+ bool get() { return _isCursorVisible; }
+ void set(bool value);
+ }
+
+ property bool IsGazeEntered
+ {
+ bool get() { return _isGazeEntered; }
+ void set(bool value);
+ }
+
+ property Point Position
+ {
+ Point get()
+ {
+ return _cursorPosition;
+ }
+
+ void set(Point value)
+ {
+ _cursorPosition = value;
+ _gazeCursor->Margin = Thickness(value.X - CursorRadius, value.Y - CursorRadius, 0, 0);
+ }
+ }
+
+ property Point PositionOriginal
+ {
+ Point get()
+ {
+ return _originalCursorPosition;
+ }
+
+ void set(Point value)
+ {
+ _originalCursorPosition = value;
+ _origSignalCursor->Margin = Thickness(value.X - CursorRadius, value.Y - CursorRadius, 0, 0);
+ }
+ }
+
+private:
+ GazeCursor();
+
+private:
+ Popup^ _gazePopup;
+ Canvas^ _gazeCanvas;
+ Shapes::Ellipse^ _gazeCursor;
+ Shapes::Ellipse^ _origSignalCursor;
+ Shapes::Rectangle^ _gazeRect;
+ Point _cursorPosition = {};
+ Point _originalCursorPosition = {};
+ int _cursorRadius = DEFAULT_CURSOR_RADIUS;
+ bool _isCursorVisible = DEFAULT_CURSOR_VISIBILITY;
+ bool _isGazeEntered;
+
+};
+
+END_NAMESPACE_GAZE_INPUT
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeElement.h b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeElement.h
new file mode 100644
index 00000000000..cabd7df89d9
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeElement.h
@@ -0,0 +1,54 @@
+//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
+//See LICENSE in the project root for license information.
+
+#pragma once
+
+#include "DwellInvokedRoutedEventArgs.h"
+#include "DwellProgressEventArgs.h"
+#include "StateChangedEventArgs.h"
+
+using namespace Windows::Foundation;
+using namespace Windows::UI::Xaml;
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+///
+/// Surrogate object attached to controls allowing subscription to per-control gaze events.
+///
+public ref class GazeElement sealed : public DependencyObject
+{
+public:
+
+ ///
+ /// This event is fired when the state of the user's gaze on a control has changed
+ ///
+ event EventHandler^ StateChanged;
+
+ ///
+ /// This event is fired when the user completed dwelling on a control and the control is about to be invoked by default. This event is fired to give the application an opportunity to prevent default invocation
+ ///
+ event EventHandler^ Invoked;
+
+ ///
+ /// This event is fired to inform the application of the progress towards dwell
+ ///
+ event EventHandler^ DwellProgressFeedback;
+
+internal:
+
+ void RaiseStateChanged(Object^ sender, StateChangedEventArgs^ args) { StateChanged(sender, args); }
+
+ void RaiseInvoked(Object^ sender, DwellInvokedRoutedEventArgs^ args)
+ {
+ Invoked(sender, args);
+ }
+
+ bool RaiseProgressFeedback(Object^ sender, DwellProgressState state, TimeSpan elapsedTime, TimeSpan triggerTime)
+ {
+ auto args = ref new DwellProgressEventArgs(state, elapsedTime, triggerTime);
+ DwellProgressFeedback(sender, args);
+ return args->Handled;
+ }
+};
+
+END_NAMESPACE_GAZE_INPUT
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeFeedbackPopupFactory.cpp b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeFeedbackPopupFactory.cpp
new file mode 100644
index 00000000000..99691b12021
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeFeedbackPopupFactory.cpp
@@ -0,0 +1,38 @@
+#include "pch.h"
+#include "GazeFeedbackPopupFactory.h"
+
+using namespace Platform::Collections;
+
+static Vector^ s_cache = ref new Vector();
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+Popup^ GazeFeedbackPopupFactory::Get()
+{
+ Popup^ popup;
+
+ if (s_cache->Size != 0)
+ {
+ popup = s_cache->GetAt(0);
+ s_cache->RemoveAt(0);
+ }
+ else
+ {
+ popup = ref new Popup();
+
+ auto rectangle = ref new Rectangle();
+ rectangle->StrokeThickness = 2;
+
+ popup->Child = rectangle;
+ }
+
+ return popup;
+}
+
+void GazeFeedbackPopupFactory::Return(Popup^ popup)
+{
+ popup->IsOpen = false;
+ s_cache->Append(popup);
+}
+
+END_NAMESPACE_GAZE_INPUT
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeFeedbackPopupFactory.h b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeFeedbackPopupFactory.h
new file mode 100644
index 00000000000..d2fe6722003
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeFeedbackPopupFactory.h
@@ -0,0 +1,16 @@
+#pragma once
+
+using namespace Windows::UI::Xaml::Controls::Primitives;
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+private ref class GazeFeedbackPopupFactory
+{
+public:
+
+ static Popup^ Get();
+
+ static void Return(Popup^ popup);
+};
+
+END_NAMESPACE_GAZE_INPUT
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeHistoryItem.h b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeHistoryItem.h
new file mode 100644
index 00000000000..b1c1121bb4f
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeHistoryItem.h
@@ -0,0 +1,19 @@
+//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
+//See LICENSE in the project root for license information.
+
+#pragma once
+
+using namespace Windows::Foundation;
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+ref class GazeTargetItem;
+
+private ref struct GazeHistoryItem
+{
+ property GazeTargetItem^ HitTarget;
+ property TimeSpan Timestamp;
+ property TimeSpan Duration;
+};
+
+END_NAMESPACE_GAZE_INPUT
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeInput.cpp b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeInput.cpp
new file mode 100644
index 00000000000..15380934338
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeInput.cpp
@@ -0,0 +1,127 @@
+//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
+//See LICENSE in the project root for license information.
+
+#include "pch.h"
+#include "GazeInput.h"
+
+#include "GazeElement.h"
+#include "GazePointer.h"
+#include "GazePointerProxy.h"
+
+using namespace Platform;
+using namespace Windows::UI;
+
+
+BEGIN_NAMESPACE_GAZE_INPUT
+
+static Brush^ s_progressBrush = ref new SolidColorBrush(Colors::Green);
+
+Brush^ GazeInput::DwellFeedbackProgressBrush::get()
+{
+ return s_progressBrush;
+}
+
+void GazeInput::DwellFeedbackCompleteBrush::set(Brush^ value)
+{
+ s_progressBrush = value;
+}
+
+static Brush^ s_completeBrush = ref new SolidColorBrush(Colors::Red);
+
+Brush^ GazeInput::DwellFeedbackCompleteBrush::get()
+{
+ return s_completeBrush;
+}
+
+void GazeInput::DwellFeedbackProgressBrush::set(Brush^ value)
+{
+ s_completeBrush = value;
+}
+
+TimeSpan GazeInput::UnsetTimeSpan = { -1 };
+
+static void OnInteractionChanged(DependencyObject^ ob, DependencyPropertyChangedEventArgs^ args)
+{
+ auto element = safe_cast(ob);
+ auto interaction = safe_cast(args->NewValue);
+ GazePointerProxy::SetGazeInteraction(element, interaction);
+}
+
+static void OnIsCursorVisibleChanged(DependencyObject^ ob, DependencyPropertyChangedEventArgs^ args)
+{
+ GazePointer::Instance->IsCursorVisible = safe_cast(args->NewValue);
+}
+
+static void OnCursorRadiusChanged(DependencyObject^ ob, DependencyPropertyChangedEventArgs^ args)
+{
+ GazePointer::Instance->CursorRadius = safe_cast(args->NewValue);
+}
+
+static DependencyProperty^ s_interactionProperty = DependencyProperty::RegisterAttached("Interaction", Interaction::typeid, GazeInput::typeid,
+ ref new PropertyMetadata(Interaction::Inherited, ref new PropertyChangedCallback(&OnInteractionChanged)));
+static DependencyProperty^ s_isCursorVisibleProperty = DependencyProperty::RegisterAttached("IsCursorVisible", bool::typeid, GazeInput::typeid,
+ ref new PropertyMetadata(true, ref new PropertyChangedCallback(&OnIsCursorVisibleChanged)));
+static DependencyProperty^ s_cursorRadiusProperty = DependencyProperty::RegisterAttached("CursorRadius", int::typeid, GazeInput::typeid,
+ ref new PropertyMetadata(6, ref new PropertyChangedCallback(&OnCursorRadiusChanged)));
+static DependencyProperty^ s_gazeElementProperty = DependencyProperty::RegisterAttached("GazeElement", GazeElement::typeid, GazeInput::typeid, ref new PropertyMetadata(nullptr));
+static DependencyProperty^ s_fixationDurationProperty = DependencyProperty::RegisterAttached("FixationDuration", TimeSpan::typeid, GazeInput::typeid, ref new PropertyMetadata(GazeInput::UnsetTimeSpan));
+static DependencyProperty^ s_dwellDurationProperty = DependencyProperty::RegisterAttached("DwellDuration", TimeSpan::typeid, GazeInput::typeid, ref new PropertyMetadata(GazeInput::UnsetTimeSpan));
+static DependencyProperty^ s_repeatDelayDurationProperty = DependencyProperty::RegisterAttached("RepeatDelayDuration", TimeSpan::typeid, GazeInput::typeid, ref new PropertyMetadata(GazeInput::UnsetTimeSpan));
+static DependencyProperty^ s_dwellRepeatDurationProperty = DependencyProperty::RegisterAttached("DwellRepeatDuration", TimeSpan::typeid, GazeInput::typeid, ref new PropertyMetadata(GazeInput::UnsetTimeSpan));
+static DependencyProperty^ s_thresholdDurationProperty = DependencyProperty::RegisterAttached("ThresholdDuration", TimeSpan::typeid, GazeInput::typeid, ref new PropertyMetadata(GazeInput::UnsetTimeSpan));
+static DependencyProperty^ s_maxRepeatCountProperty = DependencyProperty::RegisterAttached("MaxDwellRepeatCount", int::typeid, GazeInput::typeid, ref new PropertyMetadata(safe_cast