Application.Navigation.cs 2.5 KB

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