| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #nullable enable
- namespace Terminal.Gui.App;
- public static partial class Application // Navigation stuff
- {
- /// <summary>
- /// Gets the <see cref="ApplicationNavigation"/> instance for the current <see cref="Application"/>.
- /// </summary>
- public static ApplicationNavigation? Navigation { get; internal set; }
- private static Key _nextTabGroupKey = Key.F6; // Resources/config.json overrides
- private static Key _nextTabKey = Key.Tab; // Resources/config.json overrides
- private static Key _prevTabGroupKey = Key.F6.WithShift; // Resources/config.json overrides
- private static Key _prevTabKey = Key.Tab.WithShift; // Resources/config.json overrides
- /// <summary>Alternative key to navigate forwards through views. Ctrl+Tab is the primary key.</summary>
- [ConfigurationProperty (Scope = typeof (SettingsScope))]
- public static Key NextTabGroupKey
- {
- get => _nextTabGroupKey;
- set
- {
- //if (_nextTabGroupKey != value)
- {
- KeyBindings.Replace (_nextTabGroupKey, value);
- _nextTabGroupKey = value;
- }
- }
- }
- /// <summary>Alternative key to navigate forwards through views. Ctrl+Tab is the primary key.</summary>
- [ConfigurationProperty (Scope = typeof (SettingsScope))]
- public static Key NextTabKey
- {
- get => _nextTabKey;
- set
- {
- //if (_nextTabKey != value)
- {
- KeyBindings.Replace (_nextTabKey, value);
- _nextTabKey = value;
- }
- }
- }
- /// <summary>
- /// Raised when the user releases a key.
- /// <para>
- /// Set <see cref="Key.Handled"/> to <see langword="true"/> to indicate the key was handled and to prevent
- /// additional processing.
- /// </para>
- /// </summary>
- /// <remarks>
- /// All drivers support firing the <see cref="KeyDown"/> event. Some drivers (Unix) do not support firing the
- /// <see cref="KeyDown"/> and <see cref="KeyUp"/> events.
- /// <para>Fired after <see cref="KeyDown"/>.</para>
- /// </remarks>
- public static event EventHandler<Key>? KeyUp;
- /// <summary>Alternative key to navigate backwards through views. Shift+Ctrl+Tab is the primary key.</summary>
- [ConfigurationProperty (Scope = typeof (SettingsScope))]
- public static Key PrevTabGroupKey
- {
- get => _prevTabGroupKey;
- set
- {
- //if (_prevTabGroupKey != value)
- {
- KeyBindings.Replace (_prevTabGroupKey, value);
- _prevTabGroupKey = value;
- }
- }
- }
- /// <summary>Alternative key to navigate backwards through views. Shift+Ctrl+Tab is the primary key.</summary>
- [ConfigurationProperty (Scope = typeof (SettingsScope))]
- public static Key PrevTabKey
- {
- get => _prevTabKey;
- set
- {
- //if (_prevTabKey != value)
- {
- KeyBindings.Replace (_prevTabKey, value);
- _prevTabKey = value;
- }
- }
- }
- }
|