Application.Navigation.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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
  9. {
  10. get => ApplicationImpl.Instance.Navigation;
  11. internal set => ApplicationImpl.Instance.Navigation = value;
  12. }
  13. /// <summary>Alternative key to navigate forwards through views. Ctrl+Tab is the primary key.</summary>
  14. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  15. public static Key NextTabGroupKey
  16. {
  17. get => ApplicationImpl.Instance.Keyboard.NextTabGroupKey;
  18. set => ApplicationImpl.Instance.Keyboard.NextTabGroupKey = value;
  19. }
  20. /// <summary>Alternative key to navigate forwards through views. Tab is the primary key.</summary>
  21. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  22. public static Key NextTabKey
  23. {
  24. get => ApplicationImpl.Instance.Keyboard.NextTabKey;
  25. set => ApplicationImpl.Instance.Keyboard.NextTabKey = value;
  26. }
  27. /// <summary>
  28. /// Raised when the user releases a key.
  29. /// <para>
  30. /// Set <see cref="Key.Handled"/> to <see langword="true"/> to indicate the key was handled and to prevent
  31. /// additional processing.
  32. /// </para>
  33. /// </summary>
  34. /// <remarks>
  35. /// All drivers support firing the <see cref="KeyDown"/> event. Some drivers (Unix) do not support firing the
  36. /// <see cref="KeyDown"/> and <see cref="KeyUp"/> events.
  37. /// <para>Fired after <see cref="KeyDown"/>.</para>
  38. /// </remarks>
  39. public static event EventHandler<Key>? KeyUp
  40. {
  41. add => ApplicationImpl.Instance.Keyboard.KeyUp += value;
  42. remove => ApplicationImpl.Instance.Keyboard.KeyUp -= value;
  43. }
  44. /// <summary>Alternative key to navigate backwards through views. Shift+Ctrl+Tab is the primary key.</summary>
  45. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  46. public static Key PrevTabGroupKey
  47. {
  48. get => ApplicationImpl.Instance.Keyboard.PrevTabGroupKey;
  49. set => ApplicationImpl.Instance.Keyboard.PrevTabGroupKey = value;
  50. }
  51. /// <summary>Alternative key to navigate backwards through views. Shift+Tab is the primary key.</summary>
  52. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  53. public static Key PrevTabKey
  54. {
  55. get => ApplicationImpl.Instance.Keyboard.PrevTabKey;
  56. set => ApplicationImpl.Instance.Keyboard.PrevTabKey = value;
  57. }
  58. }