Browse Source

GetFocused() -> back to Focused property (get only; computed).

Tig 11 months ago
parent
commit
591baa65f0

+ 1 - 1
Terminal.Gui/Application/ApplicationNavigation.cs

@@ -117,7 +117,7 @@ public class ApplicationNavigation
             Toplevel? top = Application.Current!.Modal ? Application.Current : Application.Top;
             top!.AdvanceFocus (NavigationDirection.Backward, TabBehavior.TabGroup);
 
-            if (top.GetFocused () is null)
+            if (top.Focused is null)
             {
                 top.AdvanceFocus (NavigationDirection.Backward, null);
             }

+ 1 - 1
Terminal.Gui/Application/ApplicationOverlapped.cs

@@ -151,7 +151,7 @@ public static class ApplicationOverlapped
                 // QUESTION: AdvanceFocus returns false AND sets Focused to null if no view was found to advance to. Should't we only set focusProcessed if it returned true?
                 focusSet = true;
 
-                if (Application.Current.SuperView?.GetFocused () != Application.Current)
+                if (Application.Current.SuperView?.Focused != Application.Current)
                 {
                     return;
                 }

+ 3 - 3
Terminal.Gui/View/View.Keyboard.cs

@@ -286,7 +286,7 @@ public partial class View  // Keyboard APIs
 
         // By default the KeyBindingScope is View
 
-        if (GetFocused ()?.NewKeyDownEvent (keyEvent) == true)
+        if (Focused?.NewKeyDownEvent (keyEvent) == true)
         {
             return true;
         }
@@ -446,7 +446,7 @@ public partial class View  // Keyboard APIs
             return false;
         }
 
-        if (GetFocused ()?.NewKeyUpEvent (keyEvent) == true)
+        if (Focused?.NewKeyUpEvent (keyEvent) == true)
         {
             return true;
         }
@@ -611,7 +611,7 @@ public partial class View  // Keyboard APIs
         // Now, process any key bindings in the subviews that are tagged to KeyBindingScope.HotKey.
         foreach (View subview in Subviews)
         {
-            if (subview == GetFocused ())
+            if (subview == Focused)
             {
                 continue;
             }

+ 15 - 16
Terminal.Gui/View/View.Navigation.cs

@@ -133,7 +133,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
 
         // If we previously had a subview with focus (`Focused = subview`), we need to make sure that all subviews down the `subview`-hierarchy LeaveFocus.
         // LeaveFocus will recurse down the subview hierarchy and will also set PreviouslyMostFocused
-        View focused = GetFocused ();
+        View focused = Focused;
         focused?.LeaveFocus (this, true);
 
         // We need to ensure all superviews up the superview hierarchy have focus.
@@ -155,7 +155,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
         // - By setting _hasFocus to true we definitively change HasFocus for this view.
 
         // Get whatever peer has focus, if any
-        View focusedPeer = SuperView?.GetFocused ();
+        View focusedPeer = SuperView?.Focused;
 
         _hasFocus = true;
 
@@ -285,7 +285,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
         Leave?.Invoke (this, args);
 
         // Get whatever peer has focus, if any
-        View focusedPeer = SuperView?.GetFocused ();
+        View focusedPeer = SuperView?.Focused;
         _hasFocus = false;
 
         if (!traversingDown && CanFocus && Visible && Enabled)
@@ -355,7 +355,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
             return false;
         }
 
-        View focused = GetFocused ();
+        View focused = Focused;
 
         if (focused is {} && focused.AdvanceFocus (direction, behavior))
         {
@@ -369,7 +369,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
             return false;
         }
 
-        var focusedIndex = index.IndexOf (GetFocused ());
+        var focusedIndex = index.IndexOf (Focused);
         int next = 0;
 
         if (focusedIndex < index.Length - 1)
@@ -382,7 +382,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
             {
                 // Go down the subview-hierarchy and leave
                 // BUGBUG: This doesn't seem right
-                GetFocused ().HasFocus = false;
+                Focused.HasFocus = false;
 
                 // TODO: Should we check the return value of SetHasFocus?
 
@@ -399,7 +399,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
         }
 
         // The subview does not have focus, but at least one other that can. Can this one be focused?
-        return view.EnterFocus (GetFocused ());
+        return view.EnterFocus (Focused);
     }
 
 
@@ -411,7 +411,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
     /// </returns>
     internal bool RestoreFocus (TabBehavior? behavior)
     {
-        if (GetFocused () is null && _subviews?.Count > 0)
+        if (Focused is null && _subviews?.Count > 0)
         {
             if (_previouslyMostFocused is { }/* && (behavior is null || _previouslyMostFocused.TabStop == behavior)*/)
             {
@@ -429,19 +429,19 @@ public partial class View // Focus and cross-view navigation management (TabStop
     /// <returns>The most focused Subview, or <see langword="null"/> if no Subview is focused.</returns>
     public View GetMostFocused ()
     {
-        if (GetFocused () is null)
+        if (Focused is null)
         {
             return null;
         }
 
-        View most = GetFocused ()!.GetMostFocused ();
+        View most = Focused!.GetMostFocused ();
 
         if (most is { })
         {
             return most;
         }
 
-        return GetFocused ();
+        return Focused;
     }
 
     ///// <summary>
@@ -595,7 +595,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
                 HasFocus = false;
             }
 
-            if (_canFocus && !HasFocus && Visible && SuperView is { } && SuperView.GetFocused () is null )
+            if (_canFocus && !HasFocus && Visible && SuperView is { } && SuperView.Focused is null )
             {
                 // If CanFocus is set to true and this view does not have focus, make it enter focus
                 SetFocus ();
@@ -611,12 +611,11 @@ public partial class View // Focus and cross-view navigation management (TabStop
     /// </remarks>
     public event EventHandler CanFocusChanged;
 
-    /// <summary>Returns the currently focused Subview of this view, or <see langword="null"/> if nothing is focused.</summary>
-    /// <value>The currently focused Subview.</value>
+    /// <summary>Gets the currently focused Subview of this view, or <see langword="null"/> if nothing is focused.</summary>
     [CanBeNull]
-    public View GetFocused ()
+    public View Focused
     {
-        return Subviews.FirstOrDefault (v => v.HasFocus);
+        get { return Subviews.FirstOrDefault (v => v.HasFocus); }
     }
 
     /// <summary>

+ 2 - 2
Terminal.Gui/View/View.cs

@@ -313,7 +313,7 @@ public partial class View : Responder, ISupportInitializeNotification
                 HasFocus = false;
             }
 
-            if (_enabled && CanFocus && Visible && !HasFocus && SuperView is { } && SuperView ?.GetFocused() is null)
+            if (_enabled && CanFocus && Visible && !HasFocus && SuperView is { } && SuperView?.Focused is null)
             {
                 SetFocus ();
             }
@@ -377,7 +377,7 @@ public partial class View : Responder, ISupportInitializeNotification
                 }
             }
 
-            if (_visible && CanFocus && Enabled && !HasFocus && SuperView?.GetFocused () == null)
+            if (_visible && CanFocus && Enabled && !HasFocus && SuperView?.Focused == null)
             {
                 SetFocus ();
             }

+ 2 - 2
Terminal.Gui/Views/Menu/MenuBar.cs

@@ -391,7 +391,7 @@ public class MenuBar : View, IDesignable
         _selected = 0;
         SetNeedsDisplay ();
 
-        _previousFocused = SuperView is null ? Application.Current?.GetFocused () : SuperView.GetFocused ();
+        _previousFocused = SuperView is null ? Application.Current?.Focused : SuperView.Focused;
         OpenMenu (_selected);
 
         if (!SelectEnabledItem (
@@ -452,7 +452,7 @@ public class MenuBar : View, IDesignable
 
         if (_openMenu is null)
         {
-            _previousFocused = SuperView is null ? Application.Current?.GetFocused () ?? null : SuperView.GetFocused ();
+            _previousFocused = SuperView is null ? Application.Current?.Focused ?? null : SuperView.Focused;
         }
 
         OpenMenu (idx, sIdx, subMenu);

+ 3 - 3
Terminal.Gui/Views/TabView.cs

@@ -77,7 +77,7 @@ public class TabView : View
                         {
                             _contentView.SetFocus ();
 
-                            return _contentView.GetFocused () is { };
+                            return _contentView.Focused is { };
                         }
 
                         return false;
@@ -94,7 +94,7 @@ public class TabView : View
                                               {
                                                   _contentView.SetFocus ();
 
-                                                  return _contentView.GetFocused () is { };
+                                                  return _contentView.Focused is { };
                                               }
 
                                               return false;
@@ -1300,7 +1300,7 @@ public class TabView : View
                 // if tab is the selected one and focus is inside this control
                 if (toRender.IsSelected && _host.HasFocus)
                 {
-                    if (_host.GetFocused () == this)
+                    if (_host.Focused == this)
                     {
                         // if focus is the tab bar itself then show that they can switch tabs
                         prevAttr = ColorScheme.HotFocus;

+ 2 - 2
Terminal.Gui/Views/Toplevel.cs

@@ -431,7 +431,7 @@ public partial class Toplevel : View
     {
         if (!IsOverlappedContainer)
         {
-            if (GetFocused () is null)
+            if (Focused is null)
             {
                 RestoreFocus (null);
             }
@@ -441,7 +441,7 @@ public partial class Toplevel : View
 
         // This code path only happens when the Toplevel is an Overlapped container
 
-        if (GetFocused () is null)
+        if (Focused is null)
         {
             // TODO: this is an Overlapped hack
             foreach (Toplevel top in ApplicationOverlapped.OverlappedChildren!)

+ 2 - 2
UnitTests/Application/KeyboardTests.cs

@@ -397,7 +397,7 @@ public class KeyboardTests
         Application.Shutdown ();
     }
 
-    [Fact]
+    [Fact(Skip = "No longer valid test.")]
     [AutoInitShutdown]
     public void EnsuresTopOnFront_CanFocus_False_By_Keyboard ()
     {
@@ -457,7 +457,7 @@ public class KeyboardTests
         top.Dispose ();
     }
 
-    [Fact]
+    [Fact (Skip = "No longer valid test.")]
     [AutoInitShutdown]
     public void EnsuresTopOnFront_CanFocus_True_By_Keyboard ()
     {

+ 6 - 6
UnitTests/View/Navigation/AddRemoveTests.cs

@@ -27,7 +27,7 @@ public class AddRemoveNavigationTests (ITestOutputHelper _output) : TestsAllView
         top.Add (subView);
 
         Assert.True (top.HasFocus);
-        Assert.Equal (subView, top.GetFocused ());
+        Assert.Equal (subView, top.Focused);
         Assert.True (subView.HasFocus);
         Assert.Equal (1, nEnter);
     }
@@ -61,7 +61,7 @@ public class AddRemoveNavigationTests (ITestOutputHelper _output) : TestsAllView
         top.Add (subView);
 
         Assert.True (top.HasFocus);
-        Assert.Equal (subView, top.GetFocused ());
+        Assert.Equal (subView, top.Focused);
         Assert.True (subView.HasFocus);
         Assert.True (subSubView.HasFocus);
     }
@@ -88,12 +88,12 @@ public class AddRemoveNavigationTests (ITestOutputHelper _output) : TestsAllView
 
         top.SetFocus ();
         Assert.True (top.HasFocus);
-        Assert.Equal (subView, top.GetFocused ());
+        Assert.Equal (subView, top.Focused);
         Assert.True (subView.HasFocus);
 
         top.Remove (subView);
         Assert.True (top.HasFocus);
-        Assert.Equal (null, top.GetFocused ());
+        Assert.Equal (null, top.Focused);
         Assert.False (subView.HasFocus);
         Assert.Equal (1, nLeave);
     }
@@ -125,14 +125,14 @@ public class AddRemoveNavigationTests (ITestOutputHelper _output) : TestsAllView
 
         top.SetFocus ();
         Assert.True (top.HasFocus);
-        Assert.Equal (subView1, top.GetFocused ());
+        Assert.Equal (subView1, top.Focused);
         Assert.True (subView1.HasFocus);
         Assert.False (subView2.HasFocus);
 
         top.Remove (subView1);
         Assert.True (top.HasFocus);
         Assert.True (subView2.HasFocus);
-        Assert.Equal (subView2, top.GetFocused ());
+        Assert.Equal (subView2, top.Focused);
         Assert.False (subView1.HasFocus);
         Assert.Equal (1, nLeave1);
     }

+ 1 - 1
UnitTests/View/Navigation/CanFocusTests.cs

@@ -147,7 +147,7 @@ public class CanFocusTests (ITestOutputHelper _output) : TestsAllViews
 
         top.SetFocus ();
         Assert.True (top.HasFocus);
-        Assert.Equal (subView, top.GetFocused ());
+        Assert.Equal (subView, top.Focused);
         Assert.True (subView.HasFocus);
         Assert.True (subSubView.HasFocus);
 

+ 9 - 9
UnitTests/View/Navigation/EnabledTests.cs

@@ -40,7 +40,7 @@ public class EnabledTests (ITestOutputHelper _output) : TestsAllViews
         view.SetFocus ();
         Assert.True (view.HasFocus);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
+        Assert.Equal (subView, view.Focused);
 
         view.Enabled = false;
         Assert.False (view.HasFocus);
@@ -67,7 +67,7 @@ public class EnabledTests (ITestOutputHelper _output) : TestsAllViews
         view.SetFocus ();
         Assert.True (view.HasFocus);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
+        Assert.Equal (subView, view.Focused);
 
         view.Enabled = false;
         Assert.False (view.HasFocus);
@@ -94,7 +94,7 @@ public class EnabledTests (ITestOutputHelper _output) : TestsAllViews
         view.SetFocus ();
         Assert.True (view.HasFocus);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
+        Assert.Equal (subView, view.Focused);
 
         subView.Enabled = false;
         Assert.True (view.HasFocus);
@@ -139,13 +139,13 @@ public class EnabledTests (ITestOutputHelper _output) : TestsAllViews
 
         view.SetFocus ();
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
-        Assert.Equal (subViewSubView2, subView.GetFocused ());
+        Assert.Equal (subView, view.Focused);
+        Assert.Equal (subViewSubView2, subView.Focused);
 
         subViewSubView2.Enabled = false;
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
-        Assert.Equal (subViewSubView3, subView.GetFocused ());
+        Assert.Equal (subView, view.Focused);
+        Assert.Equal (subViewSubView3, subView.Focused);
         Assert.True (subViewSubView3.HasFocus);
     }
 
@@ -246,8 +246,8 @@ public class EnabledTests (ITestOutputHelper _output) : TestsAllViews
 
         subView.Enabled = true;
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
-        Assert.Equal (subViewSubView2, subView.GetFocused ());
+        Assert.Equal (subView, view.Focused);
+        Assert.Equal (subViewSubView2, subView.Focused);
         Assert.True (subViewSubView2.HasFocus);
     }
 

+ 4 - 4
UnitTests/View/Navigation/EnterLeaveTests.cs

@@ -330,12 +330,12 @@ public class EnterLeaveTests (ITestOutputHelper _output) : TestsAllViews
         view.Add (subview1, subview2);
 
         view.SetFocus ();
-        Assert.Equal (subview1, view.GetFocused ());
+        Assert.Equal (subview1, view.Focused);
         Assert.True (subview1.HasFocus);
         Assert.False (subview2.HasFocus);
 
         subview2.SetFocus ();
-        Assert.Equal (subview2, view.GetFocused ());
+        Assert.Equal (subview2, view.Focused);
         Assert.True (subview2.HasFocus);
         Assert.False (subview1.HasFocus);
     }
@@ -384,8 +384,8 @@ public class EnterLeaveTests (ITestOutputHelper _output) : TestsAllViews
         Assert.True (view1.HasFocus);
         Assert.True (subView1.HasFocus);
         Assert.True (subView1SubView1.HasFocus);
-        Assert.Equal (subView1, view1.GetFocused ());
-        Assert.Equal (subView1SubView1, subView1.GetFocused ());
+        Assert.Equal (subView1, view1.Focused);
+        Assert.Equal (subView1SubView1, subView1.Focused);
 
         view2.SetFocus ();
         Assert.False (view1.HasFocus);

+ 2 - 2
UnitTests/View/Navigation/HasFocusTests.cs

@@ -65,10 +65,10 @@ public class HasFocusTests (ITestOutputHelper _output) : TestsAllViews
         view.SetFocus ();
         Assert.True (view.HasFocus);
         Assert.True (subview.HasFocus);
-        Assert.Equal (subview, view.GetFocused ());
+        Assert.Equal (subview, view.Focused);
 
         view.HasFocus = false;
-        Assert.Null (view.GetFocused ());
+        Assert.Null (view.Focused);
         Assert.False (view.HasFocus);
         Assert.False (subview.HasFocus);
     }

+ 4 - 4
UnitTests/View/Navigation/NavigationTests.cs

@@ -385,12 +385,12 @@ public class NavigationTests (ITestOutputHelper _output) : TestsAllViews
     public void Focused_NoSubviews ()
     {
         var view = new View ();
-        Assert.Null (view.GetFocused ());
+        Assert.Null (view.Focused);
 
         view.CanFocus = true;
         view.SetFocus ();
         Assert.True (view.HasFocus);
-        Assert.Null (view.GetFocused ()); // BUGBUG: Should be view
+        Assert.Null (view.Focused); // BUGBUG: Should be view
     }
 
     [Fact]
@@ -497,7 +497,7 @@ public class NavigationTests (ITestOutputHelper _output) : TestsAllViews
     public void GetMostFocused_NoSubviews_Returns_Null ()
     {
         var view = new View ();
-        Assert.Null (view.GetFocused ());
+        Assert.Null (view.Focused);
 
         view.CanFocus = true;
         Assert.False (view.HasFocus);
@@ -675,7 +675,7 @@ public class NavigationTests (ITestOutputHelper _output) : TestsAllViews
         Application.Init (new FakeDriver ());
 
         var top = new Toplevel ();
-        top.Ready += (s, e) => { Assert.Null (top.GetFocused ()); };
+        top.Ready += (s, e) => { Assert.Null (top.Focused); };
 
         // Keyboard navigation with tab
         FakeConsole.MockKeyPresses.Push (new ('\t', ConsoleKey.Tab, false, false, false));

+ 14 - 14
UnitTests/View/Navigation/RestoreFocusTests.cs

@@ -43,9 +43,9 @@ public class RestoreFocusTests (ITestOutputHelper _output) : TestsAllViews
         view.SetFocus ();
         Assert.True (view.HasFocus);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
+        Assert.Equal (subView, view.Focused);
         Assert.True (subViewSubView1.HasFocus);
-        Assert.Equal (subViewSubView1, subView.GetFocused ());
+        Assert.Equal (subViewSubView1, subView.Focused);
 
         view.HasFocus = false;
         Assert.False (view.HasFocus);
@@ -57,8 +57,8 @@ public class RestoreFocusTests (ITestOutputHelper _output) : TestsAllViews
         view.RestoreFocus (view.TabStop);
         Assert.True (view.HasFocus);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
-        Assert.Equal (subViewSubView1, subView.GetFocused ());
+        Assert.Equal (subView, view.Focused);
+        Assert.Equal (subViewSubView1, subView.Focused);
         Assert.True (subViewSubView1.HasFocus);
         Assert.False (subViewSubView2.HasFocus);
         Assert.False (subViewSubView3.HasFocus);
@@ -79,9 +79,9 @@ public class RestoreFocusTests (ITestOutputHelper _output) : TestsAllViews
 
         view.RestoreFocus (view.TabStop);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
+        Assert.Equal (subView, view.Focused);
         Assert.True (subViewSubView2.HasFocus);
-        Assert.Equal (subViewSubView2, subView.GetFocused ());
+        Assert.Equal (subViewSubView2, subView.Focused);
         Assert.False (subViewSubView1.HasFocus);
         Assert.False (subViewSubView3.HasFocus);
     }
@@ -140,29 +140,29 @@ public class RestoreFocusTests (ITestOutputHelper _output) : TestsAllViews
 
         top.SetFocus ();
         Assert.True (top.HasFocus);
-        Assert.Equal (tabGroup1, top.GetFocused ());
-        Assert.Equal (tabGroup1SubView1, tabGroup1.GetFocused ());
+        Assert.Equal (tabGroup1, top.Focused);
+        Assert.Equal (tabGroup1SubView1, tabGroup1.Focused);
 
         top.AdvanceFocus (NavigationDirection.Forward, TabBehavior.TabGroup);
         Assert.True (top.HasFocus);
-        Assert.Equal (tabGroup2, top.GetFocused ());
-        Assert.Equal (tabGroup2SubView1, tabGroup2.GetFocused ());
+        Assert.Equal (tabGroup2, top.Focused);
+        Assert.Equal (tabGroup2SubView1, tabGroup2.Focused);
 
         top.HasFocus = false;
         Assert.False (top.HasFocus);
 
         top.RestoreFocus (null);
         Assert.True (top.HasFocus);
-        Assert.Equal (tabGroup2, top.GetFocused ());
-        Assert.Equal (tabGroup2SubView1, tabGroup2.GetFocused ());
+        Assert.Equal (tabGroup2, top.Focused);
+        Assert.Equal (tabGroup2SubView1, tabGroup2.Focused);
 
         top.HasFocus = false;
         Assert.False (top.HasFocus);
 
         top.RestoreFocus (TabBehavior.TabGroup);
         Assert.True (top.HasFocus);
-        Assert.Equal (tabGroup2, top.GetFocused ());
-        Assert.Equal (tabGroup2SubView1, tabGroup2.GetFocused ());
+        Assert.Equal (tabGroup2, top.Focused);
+        Assert.Equal (tabGroup2SubView1, tabGroup2.Focused);
 
 
     }

+ 11 - 11
UnitTests/View/Navigation/SetFocusTests.cs

@@ -50,7 +50,7 @@ public class SetFocusTests (ITestOutputHelper _output) : TestsAllViews
 
         view.SetFocus ();
         Assert.True (view.HasFocus);
-        Assert.Null (view.GetFocused ());
+        Assert.Null (view.Focused);
     }
 
     [Fact]
@@ -73,7 +73,7 @@ public class SetFocusTests (ITestOutputHelper _output) : TestsAllViews
 
         view.SetFocus ();
         Assert.True (view.HasFocus);
-        Assert.Equal (subview, view.GetFocused ());
+        Assert.Equal (subview, view.Focused);
     }
 
     [Fact]
@@ -94,7 +94,7 @@ public class SetFocusTests (ITestOutputHelper _output) : TestsAllViews
 
         view.SetFocus ();
         Assert.True (subview.HasFocus);
-        Assert.Equal (subview, view.GetFocused ());
+        Assert.Equal (subview, view.Focused);
     }
 
     [Fact]
@@ -135,8 +135,8 @@ public class SetFocusTests (ITestOutputHelper _output) : TestsAllViews
 
         view.SetFocus ();
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
-        Assert.Equal (subViewSubView2, subView.GetFocused ());
+        Assert.Equal (subView, view.Focused);
+        Assert.Equal (subViewSubView2, subView.Focused);
     }
 
     [Fact]
@@ -178,9 +178,9 @@ public class SetFocusTests (ITestOutputHelper _output) : TestsAllViews
         view.SetFocus ();
         Assert.True (view.HasFocus);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
+        Assert.Equal (subView, view.Focused);
         Assert.True (subViewSubView1.HasFocus);
-        Assert.Equal (subViewSubView1, subView.GetFocused ());
+        Assert.Equal (subViewSubView1, subView.Focused);
 
         subViewSubView2.SetFocus ();
         Assert.True (view.HasFocus);
@@ -213,12 +213,12 @@ public class SetFocusTests (ITestOutputHelper _output) : TestsAllViews
         view.Add (subview1, subview2);
 
         view.SetFocus ();
-        Assert.Equal (subview1, view.GetFocused ());
+        Assert.Equal (subview1, view.Focused);
         Assert.True (subview1.HasFocus);
         Assert.False (subview2.HasFocus);
 
         subview2.SetFocus ();
-        Assert.Equal (subview2, view.GetFocused ());
+        Assert.Equal (subview2, view.Focused);
         Assert.True (subview2.HasFocus);
         Assert.False (subview1.HasFocus);
     }
@@ -268,8 +268,8 @@ public class SetFocusTests (ITestOutputHelper _output) : TestsAllViews
         Assert.True (view1.HasFocus);
         Assert.True (subView1.HasFocus);
         Assert.True (subView1SubView1.HasFocus);
-        Assert.Equal (subView1, view1.GetFocused ());
-        Assert.Equal (subView1SubView1, subView1.GetFocused ());
+        Assert.Equal (subView1, view1.Focused);
+        Assert.Equal (subView1SubView1, subView1.Focused);
 
         view2.SetFocus ();
         Assert.False (view1.HasFocus);

+ 9 - 9
UnitTests/View/Navigation/VisibleTests.cs

@@ -40,7 +40,7 @@ public class VisibleTests (ITestOutputHelper _output) : TestsAllViews
         view.SetFocus ();
         Assert.True (view.HasFocus);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
+        Assert.Equal (subView, view.Focused);
 
         view.Visible = false;
         Assert.False (view.HasFocus);
@@ -67,7 +67,7 @@ public class VisibleTests (ITestOutputHelper _output) : TestsAllViews
         view.SetFocus ();
         Assert.True (view.HasFocus);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
+        Assert.Equal (subView, view.Focused);
 
         view.Visible = false;
         Assert.False (view.HasFocus);
@@ -94,7 +94,7 @@ public class VisibleTests (ITestOutputHelper _output) : TestsAllViews
         view.SetFocus ();
         Assert.True (view.HasFocus);
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
+        Assert.Equal (subView, view.Focused);
 
         subView.Visible = false;
         Assert.True (view.HasFocus);
@@ -139,13 +139,13 @@ public class VisibleTests (ITestOutputHelper _output) : TestsAllViews
 
         view.SetFocus ();
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
-        Assert.Equal (subViewSubView2, subView.GetFocused ());
+        Assert.Equal (subView, view.Focused);
+        Assert.Equal (subViewSubView2, subView.Focused);
 
         subViewSubView2.Visible = false;
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
-        Assert.Equal (subViewSubView3, subView.GetFocused ());
+        Assert.Equal (subView, view.Focused);
+        Assert.Equal (subViewSubView3, subView.Focused);
         Assert.True (subViewSubView3.HasFocus);
     }
 
@@ -246,8 +246,8 @@ public class VisibleTests (ITestOutputHelper _output) : TestsAllViews
 
         subView.Visible = true;
         Assert.True (subView.HasFocus);
-        Assert.Equal (subView, view.GetFocused ());
-        Assert.Equal (subViewSubView2, subView.GetFocused ());
+        Assert.Equal (subView, view.Focused);
+        Assert.Equal (subViewSubView2, subView.Focused);
         Assert.True (subViewSubView2.HasFocus);
     }
 }

+ 4 - 4
UnitTests/View/ViewTests.cs

@@ -765,7 +765,7 @@ At 0,0
         Assert.False (r.HasFocus);
         Assert.Equal (new (0, 0, 0, 0), r.Viewport);
         Assert.Equal (new (0, 0, 0, 0), r.Frame);
-        Assert.Null (r.GetFocused ());
+        Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
         Assert.Equal (0, r.Width);
         Assert.Equal (0, r.Height);
@@ -789,7 +789,7 @@ At 0,0
         Assert.False (r.HasFocus);
         Assert.Equal (new (0, 0, 0, 0), r.Viewport);
         Assert.Equal (new (0, 0, 0, 0), r.Frame);
-        Assert.Null (r.GetFocused ());
+        Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
         Assert.Equal (0, r.Width);
         Assert.Equal (0, r.Height);
@@ -813,7 +813,7 @@ At 0,0
         Assert.False (r.HasFocus);
         Assert.Equal (new (0, 0, 3, 4), r.Viewport);
         Assert.Equal (new (1, 2, 3, 4), r.Frame);
-        Assert.Null (r.GetFocused ());
+        Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
         Assert.Equal (3, r.Width);
         Assert.Equal (4, r.Height);
@@ -846,7 +846,7 @@ At 0,0
         Assert.False (r.HasFocus);
         Assert.Equal (new (0, 0, 1, 13), r.Viewport);
         Assert.Equal (new (0, 0, 1, 13), r.Frame);
-        Assert.Null (r.GetFocused ());
+        Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
         Assert.False (r.IsCurrentTop);
 #if DEBUG

+ 5 - 5
UnitTests/Views/AppendAutocompleteTests.cs

@@ -26,11 +26,11 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
         Assert.Equal ("f", tf.Text);
 
         // Still has focus though
-        Assert.Same (tf, Application.Top.GetFocused ());
+        Assert.Same (tf, Application.Top.Focused);
 
         // But can tab away
         Application.Driver?.SendKeys ('\t', ConsoleKey.Tab, false, false, false);
-        Assert.NotSame (tf, Application.Top.GetFocused ());
+        Assert.NotSame (tf, Application.Top.Focused);
         Application.Top.Dispose ();
     }
 
@@ -201,11 +201,11 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
         Assert.Equal ("fish", tf.Text);
 
         // Tab should autcomplete but not move focus
-        Assert.Same (tf, Application.Top.GetFocused ());
+        Assert.Same (tf, Application.Top.Focused);
 
         // Second tab should move focus (nothing to autocomplete)
         Application.Driver?.SendKeys ('\t', ConsoleKey.Tab, false, false, false);
-        Assert.NotSame (tf, Application.Top.GetFocused ());
+        Assert.NotSame (tf, Application.Top.Focused);
         Application.Top.Dispose ();
     }
 
@@ -238,7 +238,7 @@ public class AppendAutocompleteTests (ITestOutputHelper output)
 
         Application.Begin (top);
 
-        Assert.Same (tf, top.GetFocused ());
+        Assert.Same (tf, top.Focused);
 
         return tf;
     }

+ 4 - 4
UnitTests/Views/OverlappedTests.cs

@@ -1058,7 +1058,7 @@ public class OverlappedTests
         win2.Add (lblTf1W2, tf1W2, lblTvW2, tvW2, lblTf2W2, tf2W2);
 
         win1.Closing += (s, e) => isRunning = false;
-        Assert.Null (top.GetFocused ());
+        Assert.Null (top.Focused);
         Assert.Equal (top, Application.Current);
         Assert.True (top.IsCurrentTop);
         Assert.Equal (top, ApplicationOverlapped.OverlappedTop);
@@ -1071,7 +1071,7 @@ public class OverlappedTests
         Assert.Equal (win1, Application.Current);
         Assert.True (win1.IsCurrentTop);
         Assert.True (ApplicationOverlapped.IsOverlapped(win1));
-        Assert.Null (top.GetFocused ());
+        Assert.Null (top.Focused);
         Assert.Null (top.GetMostFocused ());
         Assert.Equal (tf1W1, win1.GetMostFocused ());
         Assert.True (ApplicationOverlapped.IsOverlapped(win1));
@@ -1085,7 +1085,7 @@ public class OverlappedTests
         Assert.Equal (win2, Application.Current);
         Assert.True (win2.IsCurrentTop);
         Assert.True (ApplicationOverlapped.IsOverlapped(win2));
-        Assert.Null (top.GetFocused ());
+        Assert.Null (top.Focused);
         Assert.Null (top.GetMostFocused ());
         Assert.Equal (tf1W2, win2.GetMostFocused ());
         Assert.Equal (2, ApplicationOverlapped.OverlappedChildren!.Count);
@@ -1227,7 +1227,7 @@ public class OverlappedTests
 
         Application.Current = current;
         Assert.True (current.HasFocus);
-        Assert.Equal (superView.GetFocused (), current);
+        Assert.Equal (superView.Focused, current);
         Assert.Equal (superView.GetMostFocused (), current);
 
         // Act

+ 20 - 20
UnitTests/Views/TabViewTests.cs

@@ -393,9 +393,9 @@ public class TabViewTests (ITestOutputHelper output)
 
         // Is the selected tab view hosting focused
         Assert.Equal (tab1, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
-        Assert.Equal (tv.GetMostFocused (), top.GetFocused ().GetMostFocused ());
-        Assert.Equal (tv.SelectedTab.View, top.GetFocused ().GetMostFocused ());
+        Assert.Equal (tv, top.Focused);
+        Assert.Equal (tv.GetMostFocused (), top.Focused.GetMostFocused ());
+        Assert.Equal (tv.SelectedTab.View, top.Focused.GetMostFocused ());
 
         // Press the cursor up key to focus the selected tab
         Application.OnKeyDown (Key.CursorUp);
@@ -403,8 +403,8 @@ public class TabViewTests (ITestOutputHelper output)
 
         // Is the selected tab focused
         Assert.Equal (tab1, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
-        Assert.Equal (tv.GetMostFocused (), top.GetFocused ().GetMostFocused ());
+        Assert.Equal (tv, top.Focused);
+        Assert.Equal (tv.GetMostFocused (), top.Focused.GetMostFocused ());
 
         Tab oldChanged = null;
         Tab newChanged = null;
@@ -421,8 +421,8 @@ public class TabViewTests (ITestOutputHelper output)
         Assert.Equal (tab1, oldChanged);
         Assert.Equal (tab2, newChanged);
         Assert.Equal (tab2, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
-        Assert.Equal (tv.GetMostFocused (), top.GetFocused ().GetMostFocused ());
+        Assert.Equal (tv, top.Focused);
+        Assert.Equal (tv.GetMostFocused (), top.Focused.GetMostFocused ());
 
         // Press the cursor down key. Since the selected tab has no focusable views, the focus should move to the next view in the toplevel
         Application.OnKeyDown (Key.CursorDown);
@@ -454,7 +454,7 @@ public class TabViewTests (ITestOutputHelper output)
         // Press the cursor down key again will focus next view in the toplevel, whic is the TabView
         Application.OnKeyDown (Key.CursorDown);
         Assert.Equal (tab2, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
+        Assert.Equal (tv, top.Focused);
         Assert.Equal (tab1, tv.GetMostFocused ());
 
         // Press the cursor down key to focus the selected tab view hosting again
@@ -468,8 +468,8 @@ public class TabViewTests (ITestOutputHelper output)
 
         // Is the selected tab focused
         Assert.Equal (tab2, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
-        Assert.Equal (tv.GetMostFocused (), top.GetFocused ().GetMostFocused ());
+        Assert.Equal (tv, top.Focused);
+        Assert.Equal (tv.GetMostFocused (), top.Focused.GetMostFocused ());
 
         // Press the cursor left key to select the previous tab
         Application.OnKeyDown (Key.CursorLeft);
@@ -477,8 +477,8 @@ public class TabViewTests (ITestOutputHelper output)
         Assert.Equal (tab2, oldChanged);
         Assert.Equal (tab1, newChanged);
         Assert.Equal (tab1, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
-        Assert.Equal (tv.GetMostFocused (), top.GetFocused ().GetMostFocused ());
+        Assert.Equal (tv, top.Focused);
+        Assert.Equal (tv.GetMostFocused (), top.Focused.GetMostFocused ());
 
         // Press the end key to select the last tab
         Application.OnKeyDown (Key.End);
@@ -486,8 +486,8 @@ public class TabViewTests (ITestOutputHelper output)
         Assert.Equal (tab1, oldChanged);
         Assert.Equal (tab2, newChanged);
         Assert.Equal (tab2, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
-        Assert.Equal (tv.GetMostFocused (), top.GetFocused ().GetMostFocused ());
+        Assert.Equal (tv, top.Focused);
+        Assert.Equal (tv.GetMostFocused (), top.Focused.GetMostFocused ());
 
         // Press the home key to select the first tab
         Application.OnKeyDown (Key.Home);
@@ -495,8 +495,8 @@ public class TabViewTests (ITestOutputHelper output)
         Assert.Equal (tab2, oldChanged);
         Assert.Equal (tab1, newChanged);
         Assert.Equal (tab1, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
-        Assert.Equal (tv.GetMostFocused (), top.GetFocused ().GetMostFocused ());
+        Assert.Equal (tv, top.Focused);
+        Assert.Equal (tv.GetMostFocused (), top.Focused.GetMostFocused ());
 
         // Press the page down key to select the next set of tabs
         Application.OnKeyDown (Key.PageDown);
@@ -504,8 +504,8 @@ public class TabViewTests (ITestOutputHelper output)
         Assert.Equal (tab1, oldChanged);
         Assert.Equal (tab2, newChanged);
         Assert.Equal (tab2, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
-        Assert.Equal (tv.GetMostFocused (), top.GetFocused ().GetMostFocused ());
+        Assert.Equal (tv, top.Focused);
+        Assert.Equal (tv.GetMostFocused (), top.Focused.GetMostFocused ());
 
         // Press the page up key to select the previous set of tabs
         Application.OnKeyDown (Key.PageUp);
@@ -513,8 +513,8 @@ public class TabViewTests (ITestOutputHelper output)
         Assert.Equal (tab2, oldChanged);
         Assert.Equal (tab1, newChanged);
         Assert.Equal (tab1, tv.SelectedTab);
-        Assert.Equal (tv, top.GetFocused ());
-        Assert.Equal (tv.GetMostFocused (), top.GetFocused ().GetMostFocused ());
+        Assert.Equal (tv, top.Focused);
+        Assert.Equal (tv.GetMostFocused (), top.Focused.GetMostFocused ());
         top.Dispose ();
     }
 

+ 1 - 1
UnitTests/Views/TextFieldTests.cs

@@ -1948,7 +1948,7 @@ Les Miśerables",
 
         Application.Begin (top);
 
-        Assert.Same (tf, top.GetFocused ());
+        Assert.Same (tf, top.Focused);
 
         return tf;
     }

+ 16 - 16
UnitTests/Views/ToplevelTests.cs

@@ -466,7 +466,7 @@ public partial class ToplevelTests (ITestOutputHelper output)
 
         Assert.Equal (new (0, 0, 40, 25), win1.Frame);
         Assert.Equal (new (41, 0, 40, 25), win2.Frame);
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tf1W1, top.GetMostFocused ());
 
         Assert.True (isRunning);
@@ -477,7 +477,7 @@ public partial class ToplevelTests (ITestOutputHelper output)
         Assert.True (Application.OnKeyDown (Key.F5)); // refresh
 
         Assert.True (Application.OnKeyDown (Key.Tab));
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tvW1, top.GetMostFocused ());
         Assert.True (Application.OnKeyDown (Key.Tab));
         Assert.Equal ($"\tFirst line Win1{Environment.NewLine}Second line Win1", tvW1.Text);
@@ -487,10 +487,10 @@ public partial class ToplevelTests (ITestOutputHelper output)
         var prevMostFocusedSubview = top.GetMostFocused ();
 
         Assert.True (Application.OnKeyDown (Key.F6)); // move to next TabGroup (win2)
-        Assert.Equal (win2, top.GetFocused ());
+        Assert.Equal (win2, top.Focused);
 
         Assert.True (Application.OnKeyDown (Key.F6.WithShift)); // move to prev TabGroup (win1)
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tf2W1, top.GetMostFocused ());  // BUGBUG: Should be prevMostFocusedSubview - We need to cache the last focused view in the TabGroup somehow
 
         prevMostFocusedSubview.SetFocus ();
@@ -499,13 +499,13 @@ public partial class ToplevelTests (ITestOutputHelper output)
 
         tf2W1.SetFocus ();
         Assert.True (Application.OnKeyDown (Key.Tab)); // tf2W1 is last subview in win1 - tabbing should take us to first subview of win1
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tf1W1, top.GetMostFocused ());
         Assert.True (Application.OnKeyDown (Key.CursorRight)); // move char to right in tf1W1. We're at last char so nav to next view
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tvW1, top.GetMostFocused ());
         Assert.True (Application.OnKeyDown (Key.CursorDown)); // move down to next view (tvW1)
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tvW1, top.GetMostFocused ());
 #if UNIX_KEY_BINDINGS
         Assert.True (Application.OnKeyDown (new (Key.I.WithCtrl)));
@@ -513,34 +513,34 @@ public partial class ToplevelTests (ITestOutputHelper output)
         Assert.Equal (tf2W1, top.MostFocused);
 #endif
         Assert.True (Application.OnKeyDown (Key.Tab.WithShift)); // Ignored. TextView eats shift-tab by default
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tvW1, top.GetMostFocused ());
         tvW1.AllowsTab = false;
         Assert.True (Application.OnKeyDown (Key.Tab.WithShift));
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tf1W1, top.GetMostFocused ());
         Assert.True (Application.OnKeyDown (Key.CursorLeft));
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tf2W1, top.GetMostFocused ());
         Assert.True (Application.OnKeyDown (Key.CursorUp));
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tvW1, top.GetMostFocused ());
 
         // nav to win2
         Assert.True (Application.OnKeyDown (Key.F6));
-        Assert.Equal (win2, top.GetFocused ());
+        Assert.Equal (win2, top.Focused);
         Assert.Equal (tf1W2, top.GetMostFocused ());
         Assert.True (Application.OnKeyDown (Key.F6.WithShift));
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tf2W1, top.GetMostFocused ());
         Assert.True (Application.OnKeyDown (Application.NextTabGroupKey));
-        Assert.Equal (win2, top.GetFocused ());
+        Assert.Equal (win2, top.Focused);
         Assert.Equal (tf1W2, top.GetMostFocused ());
         Assert.True (Application.OnKeyDown (Application.PrevTabGroupKey));
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tf2W1, top.GetMostFocused ());
         Assert.True (Application.OnKeyDown (Key.CursorUp));
-        Assert.Equal (win1, top.GetFocused ());
+        Assert.Equal (win1, top.Focused);
         Assert.Equal (tvW1, top.GetMostFocused ());
 
         top.Dispose ();

+ 3 - 3
UnitTests/Views/WindowTests.cs

@@ -132,7 +132,7 @@ public class WindowTests
         Assert.False (defaultWindow.HasFocus);
         Assert.Equal (new Rectangle (0, 0, Application.Screen.Width - 2, Application.Screen.Height - 2), defaultWindow.Viewport);
         Assert.Equal (new Rectangle (0, 0, Application.Screen.Width, Application.Screen.Height), defaultWindow.Frame);
-        Assert.Null (defaultWindow.GetFocused ());
+        Assert.Null (defaultWindow.Focused);
         Assert.NotNull (defaultWindow.ColorScheme);
         Assert.Equal (0, defaultWindow.X);
         Assert.Equal (0, defaultWindow.Y);
@@ -154,7 +154,7 @@ public class WindowTests
         Assert.False (windowWithFrameRectEmpty.HasFocus);
         Assert.Equal (Rectangle.Empty, windowWithFrameRectEmpty.Viewport);
         Assert.Equal (Rectangle.Empty, windowWithFrameRectEmpty.Frame);
-        Assert.Null (windowWithFrameRectEmpty.GetFocused ());
+        Assert.Null (windowWithFrameRectEmpty.Focused);
         Assert.NotNull (windowWithFrameRectEmpty.ColorScheme);
         Assert.Equal (0, windowWithFrameRectEmpty.X);
         Assert.Equal (0, windowWithFrameRectEmpty.Y);
@@ -185,7 +185,7 @@ public class WindowTests
         Assert.False (windowWithFrame1234.HasFocus);
         Assert.Equal (new (0, 0, 1, 2), windowWithFrame1234.Viewport);
         Assert.Equal (new (1, 2, 3, 4), windowWithFrame1234.Frame);
-        Assert.Null (windowWithFrame1234.GetFocused ());
+        Assert.Null (windowWithFrame1234.Focused);
         Assert.NotNull (windowWithFrame1234.ColorScheme);
         Assert.Equal (1, windowWithFrame1234.X);
         Assert.Equal (2, windowWithFrame1234.Y);

+ 59 - 3
docfx/docs/migratingfromv1.md

@@ -175,6 +175,7 @@ The API for handling keyboard input is significantly improved. See [Keyboard API
 * Use [View.Keybindings](~/api/Terminal.Gui.View.Keybindings.yml) to configure key bindings to `Command`s.
 * It should be very uncommon for v2 code to override `OnKeyPressed` etc... 
 * Anywhere `Ctrl+Q` was hard-coded as the "quit key", replace with `Application.QuitKey`.
+* See *Navigation* below for more information on v2's navigation keys.
 
 ## Updated Mouse API
 
@@ -193,17 +194,72 @@ The API for mouse input is now internally consistent and easier to use.
 * Set `View.WantContinousButtonPresses = true` to have the [Command.Accept](~/api/Terminal.Gui.Command.Accept.yml) command be invoked repeatedly as the user holds a mouse button down on the view.
 * Update any code that assumed mouse events provided coordinates relative to the `Screen`.
 
-## Cursor and Focus
+## Navigation - `Cursor`, `Focus`, `TabStop` etc... 
 
 The cursor and focus system has been redesigned in v2 to be more consistent and easier to use. If you are using custom cursor or focus logic in your application, you may need to update it to use the new system.
 
-### How to Fix
+### Cursor
+
+In v1, whether the cursor (the flashing caret) was visible or not was controlled by `View.CursorVisibility` which was an enum extracted from Ncruses/Terminfo. It only works in some cases on Linux, and only partially with `WindowsDriver`. The position of the cursor was the same as `ConsoleDriver.Row`/`Col` and determined by the last call to `ConsoleDriver.Move`. `View.PositionCursor()` could be overridden by views to cause `Application` to call `ConsoleDriver.Move` on behalf of the app and to manage setting `CursorVisiblity`. This API was confusing and bug-prone.
+
+In v2, the API is (NOT YET IMPLEMENTED) simplified. A view simply reports the style of cursor it wants and the Viewport-relative location:
+
+* `public Point? CursorPosition`
+    - If `null` the cursor is not visible
+    - If `{}` the cursor is visible at the `Point`.
+* `public event EventHandler<LocationChangedEventArgs>? CursorPositionChanged`
+* `public int? CursorStyle`
+	- If `null` the default cursor style is used.
+	- If `{}` specifies the style of cursor. See [cursor.md](cursor.md) for more.
+* `Application` now has APIs for querying available cursor styles.
+* The details in `ConsoleDriver` are no longer available to applications.	
+
+#### How to Fix (Cursor API)
 
-* Use [Application.MostFocusedView](~/api/Terminal.Gui.Application.MostFocusedView.yml) to get the most focused view in the application.
 * Use [View.CursorPosition](~/api/Terminal.Gui.View.CursorPosition.yml) to set the cursor position in a view. Set [View.CursorPosition](~/api/Terminal.Gui.View.CursorPosition.yml) to `null` to hide the cursor.
 * Set [View.CursorVisibility](~/api/Terminal.Gui.View.CursorVisibility.yml) to the cursor style you want to use.
+
+### Focus
+
+See [navigation.md](navigation.md) for more details.
+See also [Keyboard](keyboard.md) where HotKey is covered more deeply...
+
+* In v1, calling `super.Add (view)` where `view.CanFocus == true` caused all views up the hierarchy (all SuperViews) to get `CanFocus` set to `true` as well. In v2, developers need to explicitly set `CanFocus` for any view in the view-hierarchy where focus is desired. This simplifies the implementation and removes confusing automatic behavior. 
+* In v1, if `view.CanFocus == true`, `Add` would automatically set `TabStop`. In v2, the automatic setting of `TabStop` in `Add` is retained because it is not overly complex to do so and is a nice convenience for developers to not have to set both `Tabstop` and `CanFocus`. Note v2 does NOT automatically change `CanFocus` if `TabStop` is changed.
+* `view.TabStop` now describes the behavior of a view in the focus-chain. the `TabBehavior` enum includes `NoStop` (the view may be focusable, but not via next/prev keyboard nav), `TabStop` (the view may be focusable, and `NextTabStop`/`PrevTabStop` keyboard nav will stop), `TabGroup` (the view may be focusable, and `NextTabGroup`/`PrevTabGroup` keyboard nav will stop). 
+
+### How to Fix (Focus API)
+
+* Use [Application.Navigation.GetFocused()](~/api/Terminal.Gui.Application.Navigation.GetFocused.yml) to get the most focused view in the application.
 * Remove any overrides of `OnEnter` and `OnLeave` that explicitly change the cursor.
 
+### Keyboard Navigation
+
+In v2, `HotKey`s can be used to navigate across the entire application view-hierarchy. They work independently of `Focus`. This enables a user to navigate across a complex UI of nested subviews if needed (even in overlapped scenarios). An example use-case is the `AllViewsTester` scenario.
+
+In v2, unlike v1, multiple Views in an application (even within the same SuperView) can have the same `HotKey`. Each press of the `HotKey` will invoke the next `HotKey` across the View hierarchy (NOT IMPLEMENTED YET)*
+
+In v1, the keys used for navigation were both hard-coded and configurable, but in an inconsistent way. `Tab` and `Shift+Tab` worked consistently for navigating between Subviews, but were not configurable. `Ctrl+Tab` and `Ctrl+Shift+Tab` navigated across `Overlapped` views and had configurable "alternate" versions (`Ctrl+PageDown` and `Ctrl+PageUp`).
+
+In v2, this is made consistent and configurable:
+
+- `Application.NextTabStopKey` (`Key.Tab`) - Navigates to the next subview that is a `TabStop` (see below). If there is no next, the first subview that is a `TabStop` will gain focus.
+- `Application.PrevTabStopKey` (`Key.Tab.WithShift`) - Opposite of `Application.NextTabStopKey`.
+- `Key.CursorRight` - Operates identically to `Application.NextTabStopKey`.
+- `Key.CursorDown` - Operates identically to `Application.NextTabStopKey`.
+- `Key.CursorLeft` - Operates identically to `Application.PrevTabStopKey`.
+- `Key.CursorUp` - Operates identically to `Application.PrevTabStopKey`.
+- `Application.NextTabGroupKey` (`Key.F6`) - Navigates to the next view in the view-hierarchy that is a `TabGroup` (see below). If there is no next, the first view that is a `TabGroup` will gain focus.
+- `Application.PrevTabGroupKey` (`Key.F6.WithShift`) - Opposite of `Application.NextTabGroupKey`.
+
+`F6` was chosen to match [Windows](https://learn.microsoft.com/en-us/windows/apps/design/input/keyboard-accelerators#common-keyboard-accelerators)
+
+These keys are all registered as `KeyBindingScope.Application` key bindings by `Application`. Because application-scoped key bindings have the lowest priority, Views can override the behaviors of these keys (e.g. `TextView` overrides `Key.Tab` by default, enabling the user to enter `\t` into text). The `AllViews_AtLeastOneNavKey_Leaves` unit test ensures all built-in Views have at least one of the above keys that can advance. 
+
+### How to Fix (Keyboard Navigation)
+
+...
+
 ## Events now use `object sender, EventArgs args` signature
 
 Previously events in Terminal.Gui used a mixture of `Action` (no arguments), `Action<string>` (or other raw datatype) and `Action<EventArgs>`. Now all events use the `EventHandler<EventArgs>` [standard .net design pattern](https://learn.microsoft.com/en-us/dotnet/csharp/event-pattern#event-delegate-signatures).