mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 14:03:01 +08:00
Fix idle tracker not accounting global actions
This commit is contained in:
parent
9c970a9eaf
commit
4bee8c23f0
@ -6,13 +6,14 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Input
|
namespace osu.Game.Input
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Track whether the end-user is in an idle state, based on their last interaction with the game.
|
/// Track whether the end-user is in an idle state, based on their last interaction with the game.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class IdleTracker : Component, IKeyBindingHandler<PlatformAction>, IHandleGlobalKeyboardInput
|
public class IdleTracker : Component, IKeyBindingHandler<PlatformAction>, IKeyBindingHandler<GlobalAction>, IHandleGlobalKeyboardInput
|
||||||
{
|
{
|
||||||
private readonly double timeToIdle;
|
private readonly double timeToIdle;
|
||||||
|
|
||||||
@ -58,6 +59,10 @@ namespace osu.Game.Input
|
|||||||
|
|
||||||
public void OnReleased(PlatformAction action) => updateLastInteractionTime();
|
public void OnReleased(PlatformAction action) => updateLastInteractionTime();
|
||||||
|
|
||||||
|
public bool OnPressed(GlobalAction action) => updateLastInteractionTime();
|
||||||
|
|
||||||
|
public void OnReleased(GlobalAction action) => updateLastInteractionTime();
|
||||||
|
|
||||||
protected override bool Handle(UIEvent e)
|
protected override bool Handle(UIEvent e)
|
||||||
{
|
{
|
||||||
switch (e)
|
switch (e)
|
||||||
|
Loading…
Reference in New Issue
Block a user