1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 11:42:55 +08:00

Merge pull request #15302 from peppy/fix-multiplayer-chat-escape-focus

Fix gameplay chat display not losing focus on escape key press
This commit is contained in:
Dan Balasescu 2021-10-26 15:34:05 +09:00 committed by GitHub
commit 7b8982c87c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -92,6 +92,18 @@ namespace osu.Game.Tests.Visual.Multiplayer
assertChatFocused(true);
}
[Test]
public void TestFocusLostOnBackKey()
{
setLocalUserPlaying(true);
assertChatFocused(false);
AddStep("press tab", () => InputManager.Key(Key.Tab));
assertChatFocused(true);
AddStep("press escape", () => InputManager.Key(Key.Escape));
assertChatFocused(false);
}
[Test]
public void TestFocusOnTabKeyWhenNotExpanded()
{

View File

@ -10,6 +10,7 @@ using osu.Game.Input.Bindings;
using osu.Game.Online.Rooms;
using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Play;
using osuTK.Input;
namespace osu.Game.Screens.OnlinePlay.Multiplayer
{
@ -75,6 +76,15 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
{
switch (e.Action)
{
case GlobalAction.Back:
if (Textbox.HasFocus)
{
Schedule(() => Textbox.KillFocus());
return true;
}
break;
case GlobalAction.ToggleChatFocus:
if (Textbox.HasFocus)
{