KeyChangedEventArgs.cs 913 B

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