Application.Navigation.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. namespace Terminal.Gui.App;
  2. public static partial class Application // Navigation stuff
  3. {
  4. /// <summary>
  5. /// Gets the <see cref="ApplicationNavigation"/> instance for the current <see cref="Application"/>.
  6. /// </summary>
  7. [Obsolete ("The legacy static Application object is going away.")]
  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. [Obsolete ("The legacy static Application object is going away.")]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. [Obsolete ("The legacy static Application object is going away.")]
  40. public static event EventHandler<Key>? KeyUp
  41. {
  42. add => ApplicationImpl.Instance.Keyboard.KeyUp += value;
  43. remove => ApplicationImpl.Instance.Keyboard.KeyUp -= value;
  44. }
  45. /// <summary>Alternative key to navigate backwards through views. Shift+Ctrl+Tab is the primary key.</summary>
  46. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  47. public static Key PrevTabGroupKey
  48. {
  49. get => ApplicationImpl.Instance.Keyboard.PrevTabGroupKey;
  50. set => ApplicationImpl.Instance.Keyboard.PrevTabGroupKey = value;
  51. }
  52. /// <summary>Alternative key to navigate backwards through views. Shift+Tab is the primary key.</summary>
  53. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  54. public static Key PrevTabKey
  55. {
  56. get => ApplicationImpl.Instance.Keyboard.PrevTabKey;
  57. set => ApplicationImpl.Instance.Keyboard.PrevTabKey = value;
  58. }
  59. }