2
0

KeyChangedEventArgs.cs 864 B

1234567891011121314151617181920212223
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// Event args for when a <see cref="Key"/> is changed from one value to a new value (e.g. in
  4. /// <see cref="View.HotKeyChanged"/>)
  5. /// </summary>
  6. public class KeyChangedEventArgs : EventArgs
  7. {
  8. /// <summary>Creates a new instance of the <see cref="KeyChangedEventArgs"/> class</summary>
  9. /// <param name="oldKey"></param>
  10. /// <param name="newKey"></param>
  11. public KeyChangedEventArgs (Key oldKey, Key newKey)
  12. {
  13. OldKey = oldKey;
  14. NewKey = newKey;
  15. }
  16. /// <summary>Gets the new <see cref="Key"/> that is being used. Use <see cref="Key.Empty"/> to check for empty.</summary>
  17. public Key NewKey { get; }
  18. /// <summary>Gets the old <see cref="Key"/> that was set before the event. Use <see cref="Key.Empty"/> to check for empty.</summary>
  19. public Key OldKey { get; }
  20. }