Ejemplo n.º 1
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     if (DataContext is GrblViewModel)
     {
         if (keyboard == null)
         {
             keyboard = new KeypressHandler(DataContext as GrblViewModel);
             keyboard.AddHandler(Key.R, ModifierKeys.Alt, StartProbe);
             keyboard.AddHandler(Key.S, ModifierKeys.Alt, StopProbe);
         }
         DataContext = model = new ProbingViewModel(DataContext as GrblViewModel, profiles);
     }
 }
Ejemplo n.º 2
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (!keyboardMappingsOk && DataContext is GrblViewModel)
            {
                grbl = (DataContext as GrblViewModel);
                KeypressHandler keyboard = grbl.Keyboard;

                keyboardMappingsOk = true;

                keyboard.AddHandler(Key.R, ModifierKeys.Alt, StartProbe, this);
                keyboard.AddHandler(Key.S, ModifierKeys.Alt, StopProbe, this);
                keyboard.AddHandler(Key.C, ModifierKeys.Alt, ProbeConnectedToggle, this);

                DataContext = model = new ProbingViewModel(DataContext as GrblViewModel, profiles);
            }
        }
Ejemplo n.º 3
0
        private void RenderControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            textOverlay.Visibility = AppConfig.Settings.GCodeViewer.ShowTextOverlay ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden;

            if (!keyboardMappingsOk && DataContext is GrblViewModel)
            {
                KeypressHandler keyboard = (DataContext as GrblViewModel).Keyboard;

                keyboardMappingsOk = true;

                keyboard.AddHandler(Key.V, ModifierKeys.Control, ResetView);
                keyboard.AddHandler(Key.R, ModifierKeys.Control, RestoreView);
                keyboard.AddHandler(Key.G, ModifierKeys.Control, ToggleGrid);
                keyboard.AddHandler(Key.J, ModifierKeys.Control, ToggleJobEnvelope);
                keyboard.AddHandler(Key.W, ModifierKeys.Control, ToggleWorkEnvelope);
            }
        }
Ejemplo n.º 4
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     if (DataContext is GrblViewModel)
     {
         if (keyboard == null)
         {
             keyboard = new KeypressHandler(DataContext as GrblViewModel);
             keyboard.AddHandler(Key.None, ModifierKeys.Shift, EnableJog);
         }
         DataContext = model = new ProbingViewModel(DataContext as GrblViewModel, profiles);
     }
 }
Ejemplo n.º 5
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     if (DataContext is GrblViewModel)
     {
         if (keyboard == null)
         {
             keyboard = new KeypressHandler(DataContext as GrblViewModel);
             keyboard.AddHandler(Key.R, ModifierKeys.Alt, StartProbe);
             keyboard.AddHandler(Key.S, ModifierKeys.Alt, StopProbe);
             keyboard.AddHandler(Key.C, ModifierKeys.Alt, ProbeConnectedToggle);
             keyboard.AddHandler(Key.F1, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F2, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F3, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F4, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F5, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F6, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F7, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F8, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F9, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F10, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F11, ModifierKeys.None, FnKeyHandler);
             keyboard.AddHandler(Key.F12, ModifierKeys.None, FnKeyHandler);
         }
         DataContext = model = new ProbingViewModel(DataContext as GrblViewModel, profiles);
     }
 }