private void btnBS_Click(object sender, RoutedEventArgs e) { if (txtInput.Visibility == Visibility.Visible) { txtInput.Focus(); } else { pwdInput.Focus(); } MySendKey.SendKeyPress(MySendKey.KeyCode.BACKSPACE); }
private void btnCaps_CheckedChanged(object sender, RoutedEventArgs e) { bool capslock = Keyboard.GetKeyStates(Key.CapsLock) == KeyStates.Toggled; if (btnCaps.IsChecked != capslock) { MySendKey.SendKeyPress(MySendKey.KeyCode.CAPS_LOCK); } if (txtInput.Visibility == Visibility.Visible) { txtInput.Focus(); } else { pwdInput.Focus(); } Display_KeyChar(); }
private void btnKeyin_Click(object sender, RoutedEventArgs e) { if (txtInput.Visibility == Visibility.Visible) { txtInput.Focus(); } else { pwdInput.Focus(); } string inStr = (sender as Button).Tag.ToString(); char[] inChar = inStr.ToCharArray(); if (inChar.Length > 0) { MySendKey.SendKeyPress((MySendKey.KeyCode)inChar[0]); } }