From 8dd4ae55eeb71f24e2cb5647f57ab35e34e82e4b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Jun 2023 16:47:04 +0900 Subject: [PATCH 1/9] Allow selecting all text in a textbox programatically --- .../Visual/UserInterface/TestSceneTextBox.cs | 23 +++++++++++ .../Graphics/UserInterface/TextBox.cs | 40 +++++++++++++------ 2 files changed, 51 insertions(+), 12 deletions(-) diff --git a/osu.Framework.Tests/Visual/UserInterface/TestSceneTextBox.cs b/osu.Framework.Tests/Visual/UserInterface/TestSceneTextBox.cs index d93431c2437..02d6387ca8e 100644 --- a/osu.Framework.Tests/Visual/UserInterface/TestSceneTextBox.cs +++ b/osu.Framework.Tests/Visual/UserInterface/TestSceneTextBox.cs @@ -168,6 +168,29 @@ public void VariousTextBoxes() }); } + [Test] + public void TestSelectAll() + { + BasicTextBox textBox = null; + + AddStep("add number textbox", () => + { + textBoxes.Add(textBox = new BasicTextBox + { + Size = new Vector2(500, 30), + TabbableContentContainer = textBoxes + }); + }); + + AddStep(@"set arbitrary text", () => textBox.Text = "some text"); + AddAssert("not focused", () => textBox.HasFocus, () => Is.False); + + AddStep("select all", () => textBox.SelectAll()); + + AddAssert("has focus", () => textBox.HasFocus, () => Is.True); + AddAssert("has selection", () => textBox.SelectedText, () => Is.EqualTo(textBox.Text)); + } + [Test] public void TestNumbersOnly() { diff --git a/osu.Framework/Graphics/UserInterface/TextBox.cs b/osu.Framework/Graphics/UserInterface/TextBox.cs index c28d411fc9c..177ec91c5f7 100644 --- a/osu.Framework/Graphics/UserInterface/TextBox.cs +++ b/osu.Framework/Graphics/UserInterface/TextBox.cs @@ -233,8 +233,6 @@ public virtual bool OnPressed(KeyBindingPressEvent e) if (e.Action.IsCommonTextEditingAction() && ImeCompositionActive) return true; - var lastSelectionBounds = getTextSelectionBounds(); - switch (e.Action) { // Clipboard @@ -262,10 +260,7 @@ public virtual bool OnPressed(KeyBindingPressEvent e) return true; case PlatformAction.SelectAll: - selectionStart = 0; - selectionEnd = text.Length; - cursorAndLayout.Invalidate(); - onTextSelectionChanged(TextSelectionType.All, lastSelectionBounds); + SelectAll(); return true; // Cursor Manipulation @@ -321,34 +316,34 @@ public virtual bool OnPressed(KeyBindingPressEvent e) // Expand selection case PlatformAction.SelectBackwardChar: ExpandSelectionBy(-1); - onTextSelectionChanged(TextSelectionType.Character, lastSelectionBounds); + onTextSelectionChanged(TextSelectionType.Character, getTextSelectionBounds()); return true; case PlatformAction.SelectForwardChar: ExpandSelectionBy(1); - onTextSelectionChanged(TextSelectionType.Character, lastSelectionBounds); + onTextSelectionChanged(TextSelectionType.Character, getTextSelectionBounds()); return true; case PlatformAction.SelectBackwardWord: ExpandSelectionBy(GetBackwardWordAmount()); - onTextSelectionChanged(TextSelectionType.Word, lastSelectionBounds); + onTextSelectionChanged(TextSelectionType.Word, getTextSelectionBounds()); return true; case PlatformAction.SelectForwardWord: ExpandSelectionBy(GetForwardWordAmount()); - onTextSelectionChanged(TextSelectionType.Word, lastSelectionBounds); + onTextSelectionChanged(TextSelectionType.Word, getTextSelectionBounds()); return true; case PlatformAction.SelectBackwardLine: ExpandSelectionBy(GetBackwardLineAmount()); // TODO: Differentiate 'line' and 'all' selection types if/when multi-line support is added - onTextSelectionChanged(TextSelectionType.All, lastSelectionBounds); + onTextSelectionChanged(TextSelectionType.All, getTextSelectionBounds()); return true; case PlatformAction.SelectForwardLine: ExpandSelectionBy(GetForwardLineAmount()); // TODO: Differentiate 'line' and 'all' selection types if/when multi-line support is added - onTextSelectionChanged(TextSelectionType.All, lastSelectionBounds); + onTextSelectionChanged(TextSelectionType.All, getTextSelectionBounds()); return true; } @@ -999,6 +994,27 @@ private void setText(string value) cursorAndLayout.Invalidate(); } + /// + /// Select all text. + /// + /// + /// This will force focus if not already focused. + /// + public void SelectAll() + { + if (!HasFocus) + { + GetContainingInputManager().ChangeFocus(this); + Schedule(SelectAll); + return; + } + + selectionStart = 0; + selectionEnd = text.Length; + cursorAndLayout.Invalidate(); + onTextSelectionChanged(TextSelectionType.All, getTextSelectionBounds()); + } + public string SelectedText => selectionLength > 0 ? Text.Substring(selectionLeft, selectionLength) : string.Empty; /// From 418c536a2996b3c56d455c74409d4722611988ef Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Jun 2023 20:28:23 +0900 Subject: [PATCH 2/9] Undo inlining of thing that can't be --- .../Graphics/UserInterface/TextBox.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/osu.Framework/Graphics/UserInterface/TextBox.cs b/osu.Framework/Graphics/UserInterface/TextBox.cs index 177ec91c5f7..bca290f0ff3 100644 --- a/osu.Framework/Graphics/UserInterface/TextBox.cs +++ b/osu.Framework/Graphics/UserInterface/TextBox.cs @@ -233,6 +233,8 @@ public virtual bool OnPressed(KeyBindingPressEvent e) if (e.Action.IsCommonTextEditingAction() && ImeCompositionActive) return true; + var lastSelectionBounds = getTextSelectionBounds(); + switch (e.Action) { // Clipboard @@ -316,34 +318,34 @@ public virtual bool OnPressed(KeyBindingPressEvent e) // Expand selection case PlatformAction.SelectBackwardChar: ExpandSelectionBy(-1); - onTextSelectionChanged(TextSelectionType.Character, getTextSelectionBounds()); + onTextSelectionChanged(TextSelectionType.Character, lastSelectionBounds); return true; case PlatformAction.SelectForwardChar: ExpandSelectionBy(1); - onTextSelectionChanged(TextSelectionType.Character, getTextSelectionBounds()); + onTextSelectionChanged(TextSelectionType.Character, lastSelectionBounds); return true; case PlatformAction.SelectBackwardWord: ExpandSelectionBy(GetBackwardWordAmount()); - onTextSelectionChanged(TextSelectionType.Word, getTextSelectionBounds()); + onTextSelectionChanged(TextSelectionType.Word, lastSelectionBounds); return true; case PlatformAction.SelectForwardWord: ExpandSelectionBy(GetForwardWordAmount()); - onTextSelectionChanged(TextSelectionType.Word, getTextSelectionBounds()); + onTextSelectionChanged(TextSelectionType.Word, lastSelectionBounds); return true; case PlatformAction.SelectBackwardLine: ExpandSelectionBy(GetBackwardLineAmount()); // TODO: Differentiate 'line' and 'all' selection types if/when multi-line support is added - onTextSelectionChanged(TextSelectionType.All, getTextSelectionBounds()); + onTextSelectionChanged(TextSelectionType.All, lastSelectionBounds); return true; case PlatformAction.SelectForwardLine: ExpandSelectionBy(GetForwardLineAmount()); // TODO: Differentiate 'line' and 'all' selection types if/when multi-line support is added - onTextSelectionChanged(TextSelectionType.All, getTextSelectionBounds()); + onTextSelectionChanged(TextSelectionType.All, lastSelectionBounds); return true; } @@ -1009,10 +1011,12 @@ public void SelectAll() return; } + var lastSelectionBounds = getTextSelectionBounds(); + selectionStart = 0; selectionEnd = text.Length; cursorAndLayout.Invalidate(); - onTextSelectionChanged(TextSelectionType.All, getTextSelectionBounds()); + onTextSelectionChanged(TextSelectionType.All, lastSelectionBounds); } public string SelectedText => selectionLength > 0 ? Text.Substring(selectionLeft, selectionLength) : string.Empty; From e41d6a79b810a0d55b6305333d5571e921d937ff Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 17 Oct 2023 04:18:13 +0300 Subject: [PATCH 3/9] Fix SDL providing resolutions for both portrait and landscape modes on iPad --- osu.Framework/Platform/Display.cs | 2 +- osu.Framework/Platform/SDL2Window_Windowing.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Framework/Platform/Display.cs b/osu.Framework/Platform/Display.cs index 4a5a0f1444c..171a4af7d4f 100644 --- a/osu.Framework/Platform/Display.cs +++ b/osu.Framework/Platform/Display.cs @@ -25,7 +25,7 @@ public sealed class Display : IEquatable public Rectangle Bounds { get; } /// - /// The available s on this display. + /// The available s on this display, or empty if the display mode cannot be configured (e.g. mobile displays). /// public DisplayMode[] DisplayModes { get; } diff --git a/osu.Framework/Platform/SDL2Window_Windowing.cs b/osu.Framework/Platform/SDL2Window_Windowing.cs index 36391add425..5126368524d 100644 --- a/osu.Framework/Platform/SDL2Window_Windowing.cs +++ b/osu.Framework/Platform/SDL2Window_Windowing.cs @@ -369,6 +369,12 @@ private static bool tryGetDisplayFromSDL(int displayIndex, [NotNullWhen(true)] o }) .ToArray(); + // on an iPad, SDL returns a display mode for both portrait and landscape orientations, + // but we don't support having both of them in the display modes array (since display modes are usually treated as different resolutions). + // for simplicity, do not provide any display modes on iOS regardless of SDL. + if (RuntimeInfo.OS == RuntimeInfo.Platform.iOS) + displayModes = Array.Empty(); + display = new Display(displayIndex, SDL.SDL_GetDisplayName(displayIndex), new Rectangle(rect.x, rect.y, rect.w, rect.h), displayModes); return true; } From 2a8a7e8b48c9296daf4c09ffe9b48fe347596d95 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 22 Oct 2023 02:12:26 +0300 Subject: [PATCH 4/9] Disable display modes retrieval on non-desktop platforms --- .../Platform/SDL2Window_Windowing.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/osu.Framework/Platform/SDL2Window_Windowing.cs b/osu.Framework/Platform/SDL2Window_Windowing.cs index 5126368524d..a4b9e63955f 100644 --- a/osu.Framework/Platform/SDL2Window_Windowing.cs +++ b/osu.Framework/Platform/SDL2Window_Windowing.cs @@ -350,30 +350,30 @@ private static bool tryGetDisplayFromSDL(int displayIndex, [NotNullWhen(true)] o return false; } - int numModes = SDL.SDL_GetNumDisplayModes(displayIndex); + DisplayMode[] displayModes = Array.Empty(); - if (numModes < 0) + if (RuntimeInfo.IsDesktop) { - Logger.Log($"Failed to get display modes for display at index ({displayIndex}) ({rect.w}x{rect.h}). SDL Error: {SDL.SDL_GetError()} ({numModes})"); - display = null; - return false; - } + int numModes = SDL.SDL_GetNumDisplayModes(displayIndex); + + if (numModes < 0) + { + Logger.Log($"Failed to get display modes for display at index ({displayIndex}) ({rect.w}x{rect.h}). SDL Error: {SDL.SDL_GetError()} ({numModes})"); + display = null; + return false; + } - if (numModes == 0) Logger.Log($"Display at index ({displayIndex}) ({rect.w}x{rect.h}) has no display modes. Fullscreen might not work."); + if (numModes == 0) + Logger.Log($"Display at index ({displayIndex}) ({rect.w}x{rect.h}) has no display modes. Fullscreen might not work."); - var displayModes = Enumerable.Range(0, numModes) + displayModes = Enumerable.Range(0, numModes) .Select(modeIndex => { SDL.SDL_GetDisplayMode(displayIndex, modeIndex, out var mode); return mode.ToDisplayMode(displayIndex); }) .ToArray(); - - // on an iPad, SDL returns a display mode for both portrait and landscape orientations, - // but we don't support having both of them in the display modes array (since display modes are usually treated as different resolutions). - // for simplicity, do not provide any display modes on iOS regardless of SDL. - if (RuntimeInfo.OS == RuntimeInfo.Platform.iOS) - displayModes = Array.Empty(); + } display = new Display(displayIndex, SDL.SDL_GetDisplayName(displayIndex), new Rectangle(rect.x, rect.y, rect.w, rect.h), displayModes); return true; From d80f8ce9298a2393150f8fc0bc1a4439aab52d5d Mon Sep 17 00:00:00 2001 From: Susko3 Date: Thu, 26 Oct 2023 10:57:04 +0200 Subject: [PATCH 5/9] Correctly handle OTD "multi-reports" --- .../Handlers/Tablet/OpenTabletDriverHandler.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/osu.Framework/Input/Handlers/Tablet/OpenTabletDriverHandler.cs b/osu.Framework/Input/Handlers/Tablet/OpenTabletDriverHandler.cs index 00866ce92ad..ff73859cf3d 100644 --- a/osu.Framework/Input/Handlers/Tablet/OpenTabletDriverHandler.cs +++ b/osu.Framework/Input/Handlers/Tablet/OpenTabletDriverHandler.cs @@ -108,16 +108,11 @@ private void handleTabletsChanged(object? sender, IEnumerable t private void handleDeviceReported(object? sender, IDeviceReport report) { - switch (report) - { - case ITabletReport tabletReport: - handleTabletReport(tabletReport); - break; + if (report is ITabletReport tabletReport) + handleTabletReport(tabletReport); - case IAuxReport auxiliaryReport: - handleAuxiliaryReport(auxiliaryReport); - break; - } + if (report is IAuxReport auxiliaryReport) + handleAuxiliaryReport(auxiliaryReport); } private void updateOutputArea(IWindow window) From b9dc726683f6510fbcd81f45512bc8b235086ecf Mon Sep 17 00:00:00 2001 From: Susko3 Date: Thu, 26 Oct 2023 20:10:20 +0200 Subject: [PATCH 6/9] Invert if to allow button releases to happen after movement --- osu.Framework/Platform/SDL2Window_Input.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/osu.Framework/Platform/SDL2Window_Input.cs b/osu.Framework/Platform/SDL2Window_Input.cs index 6ced725c26a..92bcc262363 100644 --- a/osu.Framework/Platform/SDL2Window_Input.cs +++ b/osu.Framework/Platform/SDL2Window_Input.cs @@ -145,16 +145,17 @@ private void enqueueJoystickButtonInput(JoystickButton button, bool isPressed) private void pollMouse() { SDL.SDL_GetGlobalMouseState(out int x, out int y); - if (previousPolledPoint.X == x && previousPolledPoint.Y == y) - return; - previousPolledPoint = new Point(x, y); + if (previousPolledPoint.X != x || previousPolledPoint.Y != y) + { + previousPolledPoint = new Point(x, y); - var pos = WindowMode.Value == Configuration.WindowMode.Windowed ? Position : windowDisplayBounds.Location; - int rx = x - pos.X; - int ry = y - pos.Y; + var pos = WindowMode.Value == Configuration.WindowMode.Windowed ? Position : windowDisplayBounds.Location; + int rx = x - pos.X; + int ry = y - pos.Y; - MouseMove?.Invoke(new Vector2(rx * Scale, ry * Scale)); + MouseMove?.Invoke(new Vector2(rx * Scale, ry * Scale)); + } } public virtual void StartTextInput(bool allowIme) => ScheduleCommand(SDL.SDL_StartTextInput); From 47e8d1b423cfe13dd747f8d0a997a9fd17b72d94 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Thu, 26 Oct 2023 20:42:08 +0200 Subject: [PATCH 7/9] Fix mouse buttons not releasing outside of window --- osu.Framework/Platform/SDL2Window_Input.cs | 45 +++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/osu.Framework/Platform/SDL2Window_Input.cs b/osu.Framework/Platform/SDL2Window_Input.cs index 92bcc262363..9da0fd0c9f0 100644 --- a/osu.Framework/Platform/SDL2Window_Input.cs +++ b/osu.Framework/Platform/SDL2Window_Input.cs @@ -142,9 +142,11 @@ private void enqueueJoystickButtonInput(JoystickButton button, bool isPressed) private Point previousPolledPoint = Point.Empty; + private SDLButtonMask pressedButtons; + private void pollMouse() { - SDL.SDL_GetGlobalMouseState(out int x, out int y); + SDLButtonMask globalButtons = (SDLButtonMask)SDL.SDL_GetGlobalMouseState(out int x, out int y); if (previousPolledPoint.X != x || previousPolledPoint.Y != y) { @@ -156,6 +158,19 @@ private void pollMouse() MouseMove?.Invoke(new Vector2(rx * Scale, ry * Scale)); } + + // a button should be released if it was pressed and its current global state differs (its bit in globalButtons is set to 0) + SDLButtonMask buttonsToRelease = pressedButtons & (globalButtons ^ pressedButtons); + + // the outer if just optimises for the common case that there are no buttons to release. + if (buttonsToRelease != SDLButtonMask.None) + { + if (buttonsToRelease.HasFlagFast(SDLButtonMask.Left)) MouseUp?.Invoke(MouseButton.Left); + if (buttonsToRelease.HasFlagFast(SDLButtonMask.Middle)) MouseUp?.Invoke(MouseButton.Middle); + if (buttonsToRelease.HasFlagFast(SDLButtonMask.Right)) MouseUp?.Invoke(MouseButton.Right); + if (buttonsToRelease.HasFlagFast(SDLButtonMask.X1)) MouseUp?.Invoke(MouseButton.Button1); + if (buttonsToRelease.HasFlagFast(SDLButtonMask.X2)) MouseUp?.Invoke(MouseButton.Button2); + } } public virtual void StartTextInput(bool allowIme) => ScheduleCommand(SDL.SDL_StartTextInput); @@ -399,14 +414,18 @@ private void handleMouseWheelEvent(SDL.SDL_MouseWheelEvent evtWheel) private void handleMouseButtonEvent(SDL.SDL_MouseButtonEvent evtButton) { MouseButton button = mouseButtonFromEvent(evtButton.button); + SDLButtonMask mask = (SDLButtonMask)SDL.SDL_BUTTON(evtButton.button); + Debug.Assert(Enum.IsDefined(mask)); switch (evtButton.type) { case SDL.SDL_EventType.SDL_MOUSEBUTTONDOWN: + pressedButtons |= mask; MouseDown?.Invoke(button); break; case SDL.SDL_EventType.SDL_MOUSEBUTTONUP: + pressedButtons &= ~mask; MouseUp?.Invoke(button); break; } @@ -482,6 +501,30 @@ private MouseButton mouseButtonFromEvent(byte button) } } + /// + /// Button mask as returned from and . + /// + [Flags] + private enum SDLButtonMask + { + None = 0, + + /// + Left = 1 << 0, + + /// + Middle = 1 << 1, + + /// + Right = 1 << 2, + + /// + X1 = 1 << 3, + + /// + X2 = 1 << 4 + } + #endregion /// From 768a37de14102d6ade5566de2814542d7477a818 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Oct 2023 13:36:18 +0900 Subject: [PATCH 8/9] Update implementation to not steal focus for now --- .../Visual/UserInterface/TestSceneTextBox.cs | 50 ++++++++++--------- .../Graphics/UserInterface/TextBox.cs | 38 ++++++-------- 2 files changed, 42 insertions(+), 46 deletions(-) diff --git a/osu.Framework.Tests/Visual/UserInterface/TestSceneTextBox.cs b/osu.Framework.Tests/Visual/UserInterface/TestSceneTextBox.cs index 02d6387ca8e..f3f09e793e5 100644 --- a/osu.Framework.Tests/Visual/UserInterface/TestSceneTextBox.cs +++ b/osu.Framework.Tests/Visual/UserInterface/TestSceneTextBox.cs @@ -168,29 +168,6 @@ public void VariousTextBoxes() }); } - [Test] - public void TestSelectAll() - { - BasicTextBox textBox = null; - - AddStep("add number textbox", () => - { - textBoxes.Add(textBox = new BasicTextBox - { - Size = new Vector2(500, 30), - TabbableContentContainer = textBoxes - }); - }); - - AddStep(@"set arbitrary text", () => textBox.Text = "some text"); - AddAssert("not focused", () => textBox.HasFocus, () => Is.False); - - AddStep("select all", () => textBox.SelectAll()); - - AddAssert("has focus", () => textBox.HasFocus, () => Is.True); - AddAssert("has selection", () => textBox.SelectedText, () => Is.EqualTo(textBox.Text)); - } - [Test] public void TestNumbersOnly() { @@ -825,6 +802,33 @@ public void TestSetTextSelection() AddAssert("nothing selected", () => textBox.SelectedText == string.Empty); } + [Test] + public void TestSelectAll() + { + TextBox textBox = null; + + AddStep("add textbox", () => + { + textBoxes.Add(textBox = new BasicTextBox + { + Size = new Vector2(300, 40), + Text = "initial text", + }); + }); + + AddAssert("select all fails", () => textBox.SelectAll(), () => Is.False); + AddAssert("no text selected", () => textBox.SelectedText, () => Is.EqualTo(string.Empty)); + + AddStep("click on textbox", () => + { + InputManager.MoveMouseTo(textBox); + InputManager.Click(MouseButton.Left); + }); + + AddAssert("select all succeeds", () => textBox.SelectAll(), () => Is.True); + AddAssert("all text selected", () => textBox.SelectedText, () => Is.EqualTo(textBox.Text)); + } + private void prependString(InsertableTextBox textBox, string text) { InputManager.Keys(PlatformAction.MoveBackwardLine); diff --git a/osu.Framework/Graphics/UserInterface/TextBox.cs b/osu.Framework/Graphics/UserInterface/TextBox.cs index 558631bbfdc..617c7f9cffc 100644 --- a/osu.Framework/Graphics/UserInterface/TextBox.cs +++ b/osu.Framework/Graphics/UserInterface/TextBox.cs @@ -359,6 +359,21 @@ public virtual void OnReleased(KeyBindingReleaseEvent e) { } + /// + /// Selects all text in this . Focus must be acquired before calling this method. + /// + /// Whether text has been selected successfully. Returns false if the text box does not have focus. + public bool SelectAll() + { + if (!HasFocus) + return false; + + selectionStart = 0; + selectionEnd = text.Length; + cursorAndLayout.Invalidate(); + return true; + } + /// /// Find the word boundary in the backward direction, then return the negative amount of characters. /// @@ -999,29 +1014,6 @@ private void setText(string value) cursorAndLayout.Invalidate(); } - /// - /// Select all text. - /// - /// - /// This will force focus if not already focused. - /// - public void SelectAll() - { - if (!HasFocus) - { - GetContainingInputManager().ChangeFocus(this); - Schedule(SelectAll); - return; - } - - var lastSelectionBounds = getTextSelectionBounds(); - - selectionStart = 0; - selectionEnd = text.Length; - cursorAndLayout.Invalidate(); - onTextSelectionChanged(TextSelectionType.All, lastSelectionBounds); - } - public string SelectedText => selectionLength > 0 ? Text.Substring(selectionLeft, selectionLength) : string.Empty; /// From 0cf3239e97f59145bb3a49f4b93212701fb9d56b Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Mon, 30 Oct 2023 08:16:09 +0300 Subject: [PATCH 9/9] Fix refactor error --- osu.Framework/Graphics/UserInterface/TextBox.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Framework/Graphics/UserInterface/TextBox.cs b/osu.Framework/Graphics/UserInterface/TextBox.cs index 617c7f9cffc..d9a74aecabd 100644 --- a/osu.Framework/Graphics/UserInterface/TextBox.cs +++ b/osu.Framework/Graphics/UserInterface/TextBox.cs @@ -266,6 +266,7 @@ public virtual bool OnPressed(KeyBindingPressEvent e) case PlatformAction.SelectAll: SelectAll(); + onTextSelectionChanged(TextSelectionType.All, lastSelectionBounds); return true; // Cursor Manipulation