Application.Navigation.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #nullable enable
  2. namespace Terminal.Gui.App;
  3. public static partial class Application // Navigation stuff
  4. {
  5. /// <summary>
  6. /// Gets the <see cref="ApplicationNavigation"/> instance for the current <see cref="Application"/>.
  7. /// </summary>
  8. public static ApplicationNavigation? Navigation { get; internal set; }
  9. /// <summary>Alternative key to navigate forwards through views. Ctrl+Tab is the primary key.</summary>
  10. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  11. public static Key NextTabGroupKey
  12. {
  13. get => Keyboard.NextTabGroupKey;
  14. set => Keyboard.NextTabGroupKey = value;
  15. }
  16. /// <summary>Alternative key to navigate forwards through views. Tab is the primary key.</summary>
  17. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  18. public static Key NextTabKey
  19. {
  20. get => Keyboard.NextTabKey;
  21. set => Keyboard.NextTabKey = value;
  22. }
  23. /// <summary>
  24. /// Raised when the user releases a key.
  25. /// <para>
  26. /// Set <see cref="Key.Handled"/> to <see langword="true"/> to indicate the key was handled and to prevent
  27. /// additional processing.
  28. /// </para>
  29. /// </summary>
  30. /// <remarks>
  31. /// All drivers support firing the <see cref="KeyDown"/> event. Some drivers (Unix) do not support firing the
  32. /// <see cref="KeyDown"/> and <see cref="KeyUp"/> events.
  33. /// <para>Fired after <see cref="KeyDown"/>.</para>
  34. /// </remarks>
  35. public static event EventHandler<Key>? KeyUp
  36. {
  37. add => Keyboard.KeyUp += value;
  38. remove => Keyboard.KeyUp -= value;
  39. }
  40. /// <summary>Alternative key to navigate backwards through views. Shift+Ctrl+Tab is the primary key.</summary>
  41. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  42. public static Key PrevTabGroupKey
  43. {
  44. get => Keyboard.PrevTabGroupKey;
  45. set => Keyboard.PrevTabGroupKey = value;
  46. }
  47. /// <summary>Alternative key to navigate backwards through views. Shift+Tab is the primary key.</summary>
  48. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  49. public static Key PrevTabKey
  50. {
  51. get => Keyboard.PrevTabKey;
  52. set => Keyboard.PrevTabKey = value;
  53. }
  54. }