mirror of https://github.com/ppy/osu
Fix gameplay chat display not losing focus on escape key press
Closes #15293.
This commit is contained in:
parent
8015791d4c
commit
6c38028d06
|
@ -92,6 +92,18 @@ public void TestFocusOnTabKeyWhenExpanded()
|
||||||
assertChatFocused(true);
|
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]
|
[Test]
|
||||||
public void TestFocusOnTabKeyWhenNotExpanded()
|
public void TestFocusOnTabKeyWhenNotExpanded()
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Screens.OnlinePlay.Match.Components;
|
using osu.Game.Screens.OnlinePlay.Match.Components;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||||
{
|
{
|
||||||
|
@ -75,6 +76,15 @@ public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||||
{
|
{
|
||||||
switch (e.Action)
|
switch (e.Action)
|
||||||
{
|
{
|
||||||
|
case GlobalAction.Back:
|
||||||
|
if (Textbox.HasFocus)
|
||||||
|
{
|
||||||
|
Schedule(() => Textbox.KillFocus());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case GlobalAction.ToggleChatFocus:
|
case GlobalAction.ToggleChatFocus:
|
||||||
if (Textbox.HasFocus)
|
if (Textbox.HasFocus)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue