mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
only show warning when focused
This commit is contained in:
@ -44,10 +44,24 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Key == OpenTK.Input.Key.CapsLock)
|
if (args.Key == OpenTK.Input.Key.CapsLock)
|
||||||
warning.FadeTo(host.CapsLockEnabled ? 1 : 0, 250, Easing.OutQuint);
|
updateCapsWarning(host.CapsLockEnabled);
|
||||||
return base.OnKeyDown(state, args);
|
return base.OnKeyDown(state, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnFocus(InputState state)
|
||||||
|
{
|
||||||
|
updateCapsWarning(host.CapsLockEnabled);
|
||||||
|
base.OnFocus(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnFocusLost(InputState state)
|
||||||
|
{
|
||||||
|
updateCapsWarning(false);
|
||||||
|
base.OnFocusLost(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateCapsWarning(bool visible) => warning.FadeTo(visible ? 1 : 0, 250, Easing.OutQuint);
|
||||||
|
|
||||||
public class PasswordMaskChar : Container
|
public class PasswordMaskChar : Container
|
||||||
{
|
{
|
||||||
private readonly CircularContainer circle;
|
private readonly CircularContainer circle;
|
||||||
|
Reference in New Issue
Block a user