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:
commit
7b8982c87c
@ -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()
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user