KeyChangedEventArgs.cs 732 B

1234567891011121314151617181920212223242526272829
  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. public KeyChangedEventArgs (Key oldKey, Key newKey)
  19. {
  20. this.OldKey = oldKey;
  21. this.NewKey = newKey;
  22. }
  23. }
  24. }