1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 05:17:29 +08:00
osu-lazer/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs
smoogipoo 5cfb2c2ffe Make VolumeControlReceptor handle global input
Fixes volume not being able to be changed in dead areas of OverlayContainers.
2018-01-11 19:03:31 +09:00

20 lines
709 B
C#

// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Game.Input.Bindings;
namespace osu.Game.Graphics.UserInterface.Volume
{
public class VolumeControlReceptor : Container, IKeyBindingHandler<GlobalAction>, IHandleGlobalInput
{
public Func<GlobalAction, bool> ActionRequested;
public bool OnPressed(GlobalAction action) => ActionRequested?.Invoke(action) ?? false;
public bool OnReleased(GlobalAction action) => false;
}
}