1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 08:22:56 +08:00

Override Handle(UIEvent e) in IdleTracker

This commit is contained in:
Roman Kapustin 2018-09-25 20:11:10 +03:00
parent c7b3fa51d5
commit bdba22a576

View File

@ -4,8 +4,7 @@
using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.EventArgs;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
namespace osu.Game.Screens.Menu
{
@ -24,14 +23,19 @@ namespace osu.Game.Screens.Menu
public bool OnReleased(PlatformAction action) => updateLastInteractionTime();
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) => updateLastInteractionTime();
protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) => updateLastInteractionTime();
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => updateLastInteractionTime();
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) => updateLastInteractionTime();
protected override bool OnMouseMove(InputState state) => updateLastInteractionTime();
protected override bool Handle(UIEvent e)
{
switch (e)
{
case KeyDownEvent _:
case KeyUpEvent _:
case MouseDownEvent _:
case MouseUpEvent _:
case MouseMoveEvent _:
return updateLastInteractionTime();
default:
return base.Handle(e);
}
}
}
}