private void HandleKeyDown() { if (!string.IsNullOrEmpty(this.DisplayKey)) { if (this.DisplayKey.ToUpper() == "C") { IInputElement targetelement = Keyboard.FocusedElement; if (targetelement != null) { if (targetelement as TextBox != null) { (targetelement as TextBox).Text = string.Empty; } else if (targetelement as PasswordBox != null) { (targetelement as PasswordBox).Password = string.Empty; } } return; } for (int i = 0; i < this.DisplayKey.Length; i++) { SoftKeyboardManager.PressSoftKey(this.DisplayKey[i] + ""); } } }
void HandleKeyDown() { if (!string.IsNullOrEmpty(this.DisplayKey)) { if (this.DisplayKey == "Shift" && this.ParentKeyboard != null) { this.ParentKeyboard.IsShiftPressed = !this.ParentKeyboard.IsShiftPressed; return; } if (this.ParentKeyboard == null) { SoftKeyboardManager.PressSoftKey(this.DisplayKey, this.EffectiveKey, this.IsShiftPressed, this.IsCapsLock); } else { SoftKeyboardManager.PressSoftKey(this.DisplayKey, this.EffectiveKey, this.ParentKeyboard.IsShiftPressed, this.ParentKeyboard.IsCapsLock); } } }