/// <summary> /// Keys the pressed. /// </summary> /// <param name="key">The key.</param> private void KeyPressed(KeyboardKey key) { this.strings.AppendLine(String.Format("Keyboard Pressed: {0}", key.Key)); }
/// <summary> /// Called when a keyboard button is released. /// </summary> /// <param name="key">The key.</param> internal void OnInputKeyboardRelease(KeyboardKey key) { if (this.HasFocus) { this.KeyUp(this, new KeyboardEventArgs(key)); } else { foreach (var control in this.Controls) { if (control.Enabled) { control.OnInputKeyboardRelease(key); } } } }
/// <summary> /// Initializes a new instance of the <see cref="KeyboardEventArgs" /> class. /// </summary> /// <param name="key">The key.</param> public KeyboardEventArgs(KeyboardKey key) : base() { this.Key = key; }
/// <summary> /// Listens for keyboard button release. /// </summary> /// <param name="key">The key.</param> private void OnInputKeyboardReleased(KeyboardKey key) { if (!this.Transitioning) { if (this.focus != null) { this.focus.OnInputKeyboardRelease(key); } } }
/// <summary> /// Initializes a new instance of the <see cref="KeyboardEventArgs" /> class. /// </summary> /// <param name="time">The time.</param> /// <param name="key">The key.</param> public KeyboardEventArgs(double time, KeyboardKey key) : base(time) { this.Key = key; }