From eca55d7d4286376a92c70db70c0bbc3f26be75c4 Mon Sep 17 00:00:00 2001 From: BDisp Date: Sat, 15 Jan 2022 22:54:49 +0000 Subject: [PATCH] Allows navigation to outside a TextView if IsMdiContainer is true. --- Terminal.Gui/Views/TextView.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Terminal.Gui/Views/TextView.cs b/Terminal.Gui/Views/TextView.cs index e62d1bd89..e6f7597f2 100644 --- a/Terminal.Gui/Views/TextView.cs +++ b/Terminal.Gui/Views/TextView.cs @@ -1362,7 +1362,7 @@ namespace Terminal.Gui { } var posX = currentColumn - leftColumn; var posY = currentRow - topRow; - if ( posX > -1 && col >= posX && posX < Frame.Width - RightOffset + if (posX > -1 && col >= posX && posX < Frame.Width - RightOffset && topRow <= currentRow && posY < Frame.Height - BottomOffset) { ResetCursorVisibility (); Move (col, currentRow - topRow); @@ -2568,6 +2568,22 @@ namespace Terminal.Gui { } break; + case Key _ when ShortcutHelper.GetModifiersKey (kb) == (Key.Tab | Key.CtrlMask): + case Key _ when ShortcutHelper.GetModifiersKey (kb) == Application.AlternateForwardKey: + if (Application.MdiTop != null) { + return SuperView?.FocusNext () == true; + } + + return false; + + case Key _ when ShortcutHelper.GetModifiersKey (kb) == (Key.Tab | Key.CtrlMask | Key.ShiftMask): + case Key _ when ShortcutHelper.GetModifiersKey (kb) == Application.AlternateBackwardKey: + if (Application.MdiTop != null) { + return SuperView?.FocusPrev () == true; + } + + return false; + default: // Ignore control characters and other special keys if (kb.Key < Key.Space || kb.Key > Key.CharMask)