Example #1
0
        /// <summary>
        /// Attach GazePointer behavior to this window
        /// </summary>
        public static GazePointer Attach(Window window, GazeClickParameters clickParams = null, GetGazeClickParameters getGazeClickParams = null,
                                         Settings settings = null, bool forceMouseCursor = false)
        {
            if (settings == null)
            {
                settings = new Settings();
            }

            if (_gazeDataProvider == null)
            {
                _gazeDataProvider = GazeDataProvider.InitializeGazeDataProvider(settings.Sensor);
            }

            return(new GazePointer(
                       window,
                       clickParams ?? new GazeClickParameters
            {
                MouseDownDelay = 1 * DefaultMouseDownDelay,
                MouseUpDelay = 2 * DefaultMouseDownDelay,
                RepeatMouseDownDelay = 3 * DefaultMouseDownDelay
            },
                       getGazeClickParams,
                       settings,
                       forceMouseCursor
                       ));
        }
        // TODO: The Accept button should just set IsEulaAccepted true and be done. In order to
        // perform first-time configuration asynchronously in a sane manner, that is currently
        // being done as a side-effect of accepting the EULA. When the code is converted to use
        // the async model the CreateProfileAsync method will be removed.
        async void OnAcceptAsync(object sender, RoutedEventArgs e)
        {
            VisualStateManager.GoToElementState(TheGrid, "ConfiguringSystem", true);

            var provider = GazeDataProvider.InitializeGazeDataProvider();
            var created  = await provider.CreateProfileAsync();

            AppSettings.Instance.Keyboard.IsEulaAccepted = created;
            provider.Terminate();
            Close();
        }
        private void InitGazeProvider()
        {
            if (_gazeProvider != null)
            {
                return;
            }
            Debug.Log("Initializing provider: " + ProviderSDK);

            UpdateCurrentProvider();

            if (_compilerFlagString != null)
            {
                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, _compilerFlagString);
            }

            _gazeProvider = GetProvider();
            _gazeProvider.Initialize();
        }