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

Change IdleHandler to not consider mouse movement as active unless focused

This commit is contained in:
Dean Herbert 2021-12-26 16:26:33 +09:00
parent 3527e3181b
commit e448c28cad

View File

@ -1,11 +1,13 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Platform;
using osu.Game.Input.Bindings;
namespace osu.Game.Input
@ -63,8 +65,14 @@ namespace osu.Game.Input
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e) => updateLastInteractionTime();
[Resolved]
private GameHost host { get; set; }
protected override bool Handle(UIEvent e)
{
if (!host.IsActive.Value)
return base.Handle(e);
switch (e)
{
case KeyDownEvent _: