private void ShowCursor_Toggle(object sender, RoutedEventArgs e)
 {
     if (ShowCursor.IsChecked.HasValue)
     {
         GazeInput.SetIsCursorVisible(this, ShowCursor.IsChecked.Value);
     }
 }
示例#2
0
 /// <summary>
 /// Creates a new PianoPage (home page for playing music)
 /// </summary>
 public PianoPage()
 {
     InitializeComponent();
     GazeInput.SetIsCursorVisible(this, true);
     this.CurrentMode = PianoMode.SingleNote;
     LoadNotesAndChords();
     this.Octave             = 3;
     this.CurrentOctave.Text = "Octave " + this.Octave;
 }
示例#3
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     GazeInput.SetIsCursorVisible(this, false);
     GazeInput.SetCursorRadius(this, 40);
     GazeInput.DwellStrokeThickness       = 6;
     GazeInput.DwellFeedbackEnterBrush    = new SolidColorBrush(Colors.DarkGray);
     GazeInput.DwellFeedbackProgressBrush = new SolidColorBrush(Colors.LightGray);
     GazeInput.DwellFeedbackCompleteBrush = new SolidColorBrush(Colors.White);
 }
        public async Task Init()
        {
            await App.Dispatcher.ExecuteOnUIThreadAsync(() =>
            {
                var xamlItemsPanelTemplate = @"<Grid xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
                                                 xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
                                                 xmlns:g='using:Microsoft.Toolkit.Uwp.Input.GazeInteraction'>
                        <Button HorizontalAlignment='Center' BorderBrush='#7FFFFFFF'
                                    g:GazeInput.ThresholdDuration='50'
                                    g:GazeInput.FixationDuration='350'
                                    g:GazeInput.DwellDuration='400'
                                    g:GazeInput.RepeatDelayDuration='400'
                                    g:GazeInput.DwellRepeatDuration='400'
                                    g:GazeInput.MaxDwellRepeatCount='0'
                                    Content='Gaze click here'
                                    Width='100'
                                    Height='100'/>
                    </Grid>";
                _grid = XamlReader.Load(xamlItemsPanelTemplate) as Grid;

                GazeInput.SetInteraction(_grid, Interaction.Enabled);
                GazeInput.SetIsCursorVisible(_grid, true);
                GazeInput.SetCursorRadius(_grid, 20);
                GazeInput.SetIsSwitchEnabled(_grid, false);

                _button        = (Button)_grid.Children.First();
                _button.Click += (sender, e) =>
                {
                    _button.Content = "Clicked";
                };

                var gazeButtonControl = GazeInput.GetGazeElement(_button);

                if (gazeButtonControl == null)
                {
                    gazeButtonControl = new GazeElement();
                    GazeInput.SetGazeElement(_button, gazeButtonControl);
                }

                TestsPage.Instance.SetMainTestContent(_grid);
            });
        }
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            GazeInput.DwellFeedbackCompleteBrush = new SolidColorBrush(Colors.DimGray);
            GazeInput.DwellFeedbackEnterBrush    = new SolidColorBrush(Colors.DimGray);

            GazeInput.SetIsCursorVisible(this, false);

            if (_navParams != null)
            {
                if (_navParams.NeedsSaving)
                {
                    SaveConfigFile(PhraseConfigFile);
                }
                MasterViewModel.GoToNode(_navParams.CurrentNode);
                ShowHideTileNavigation();
                _navParams = null;
            }
            else
            {
                LoadConfigFile(PhraseConfigFile);

                _tileViewer              = UIHelper.FindChildControl <ScrollViewer>(grdvwPhrases, "ScrollViewer") as ScrollViewer;
                _tileViewer.ViewChanged += Viewer_ViewChanged;

                DataContext          = MasterViewModel;
                groupTilesCVS.Source = MasterViewModel.Tiles;
            }
            if (MasterViewModel.Settings.GazePlusClickMode)
            {
                GazeInput.SetIsSwitchEnabled(this, true);
            }
            else
            {
                GazeInput.SetIsSwitchEnabled(this, false);
            }
        }
示例#6
0
 private void CursorVisible_Unchecked(object sender, RoutedEventArgs e)
 {
     GazeInput.SetIsCursorVisible(this, false);
 }
 /// <summary>
 /// Toggles Gaze Pointer on/off
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ToggleGazeDotClick(object sender, RoutedEventArgs e)
 {
     GazeInput.SetIsCursorVisible(this, !GazeInput.GetIsCursorVisible(this));
 }
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     GazeInput.SetIsCursorVisible(this, false);
 }