private void _listener_OnKeyPressed(object sender, KeyPressedArgs e) { Global.UltimaKey = e.KeyPressed; if (e.KeyPressed.Equals(Key.F1) || e.KeyPressed.Equals(Key.F2) || e.KeyPressed.Equals(Key.F3) || e.KeyPressed.Equals(Key.F4) || e.KeyPressed.Equals(Key.F5) || e.KeyPressed.Equals(Key.F6) || e.KeyPressed.Equals(Key.F7) || e.KeyPressed.Equals(Key.F8) || e.KeyPressed.Equals(Key.F9) || e.KeyPressed.Equals(Key.F10) || e.KeyPressed.Equals(Key.F11) || e.KeyPressed.Equals(Key.F12) || e.KeyPressed.Equals(Key.NumPad0) || e.KeyPressed.Equals(Key.NumPad1) || e.KeyPressed.Equals(Key.NumPad2) || e.KeyPressed.Equals(Key.NumPad3) || e.KeyPressed.Equals(Key.NumPad4) || e.KeyPressed.Equals(Key.NumPad5) || e.KeyPressed.Equals(Key.NumPad6) || e.KeyPressed.Equals(Key.NumPad7) || e.KeyPressed.Equals(Key.NumPad8) || e.KeyPressed.Equals(Key.NumPad9)) { LabelTeclaAtual.Content = e.KeyPressed.ToString(); Global.EditandoKey = e.KeyPressed; TextBoxTextoMacro.IsEnabled = true; ButtonSalvar.IsEnabled = true; CheckBoxAll.IsEnabled = true; ButtonMais.IsEnabled = true; ButtonDividir.IsEnabled = true; TextBoxTextoMacro.Focus(); TextBoxTextoMacro.SelectionStart = TextBoxTextoMacro.Text.Length; } switch (Global.EditandoKey) { case Key.F1: TextBoxTextoMacro.Text = Settings.Default.F1; CheckBoxAll.IsChecked = Settings.Default.F1All; break; case Key.F2: TextBoxTextoMacro.Text = Settings.Default.F2; CheckBoxAll.IsChecked = Settings.Default.F2All; break; case Key.F3: TextBoxTextoMacro.Text = Settings.Default.F3; CheckBoxAll.IsChecked = Settings.Default.F3All; break; case Key.F4: TextBoxTextoMacro.Text = Settings.Default.F4; CheckBoxAll.IsChecked = Settings.Default.F4All; break; case Key.F5: TextBoxTextoMacro.Text = Settings.Default.F5; CheckBoxAll.IsChecked = Settings.Default.F5All; break; case Key.F6: TextBoxTextoMacro.Text = Settings.Default.F6; CheckBoxAll.IsChecked = Settings.Default.F6All; break; case Key.F7: TextBoxTextoMacro.Text = Settings.Default.F7; CheckBoxAll.IsChecked = Settings.Default.F7All; break; case Key.F8: TextBoxTextoMacro.Text = Settings.Default.F8; CheckBoxAll.IsChecked = Settings.Default.F8All; break; case Key.F9: TextBoxTextoMacro.Text = Settings.Default.F9; CheckBoxAll.IsChecked = Settings.Default.F9All; break; case Key.F10: TextBoxTextoMacro.Text = Settings.Default.F10; CheckBoxAll.IsChecked = Settings.Default.F10All; break; case Key.F11: TextBoxTextoMacro.Text = Settings.Default.F11; CheckBoxAll.IsChecked = Settings.Default.F11All; break; case Key.F12: TextBoxTextoMacro.Text = Settings.Default.F12; CheckBoxAll.IsChecked = Settings.Default.F12All; break; case Key.NumPad0: TextBoxTextoMacro.Text = Settings.Default.NumPad0; CheckBoxAll.IsChecked = Settings.Default.NumPad0All; break; case Key.NumPad1: TextBoxTextoMacro.Text = Settings.Default.NumPad1; CheckBoxAll.IsChecked = Settings.Default.NumPad1All; break; case Key.NumPad2: TextBoxTextoMacro.Text = Settings.Default.NumPad2; CheckBoxAll.IsChecked = Settings.Default.NumPad2All; break; case Key.NumPad3: TextBoxTextoMacro.Text = Settings.Default.NumPad3; CheckBoxAll.IsChecked = Settings.Default.NumPad3All; break; case Key.NumPad4: TextBoxTextoMacro.Text = Settings.Default.NumPad4; CheckBoxAll.IsChecked = Settings.Default.NumPad4All; break; case Key.NumPad5: TextBoxTextoMacro.Text = Settings.Default.NumPad5; CheckBoxAll.IsChecked = Settings.Default.NumPad5All; break; case Key.NumPad6: TextBoxTextoMacro.Text = Settings.Default.NumPad6; CheckBoxAll.IsChecked = Settings.Default.NumPad6All; break; case Key.NumPad7: TextBoxTextoMacro.Text = Settings.Default.NumPad7; CheckBoxAll.IsChecked = Settings.Default.NumPad7All; break; case Key.NumPad8: TextBoxTextoMacro.Text = Settings.Default.NumPad8; CheckBoxAll.IsChecked = Settings.Default.NumPad8All; break; case Key.NumPad9: TextBoxTextoMacro.Text = Settings.Default.NumPad9; CheckBoxAll.IsChecked = Settings.Default.NumPad9All; break; } }
private void ButtonDividir_OnClick(object sender, RoutedEventArgs e) { TextBoxTextoMacro.Text += "|"; TextBoxTextoMacro.Focus(); TextBoxTextoMacro.SelectionStart = TextBoxTextoMacro.Text.Length; }