Remove usage of key repeat helper method

This commit is contained in:
Dean Herbert
2021-11-18 12:38:20 +09:00
parent d7b178ea37
commit 66c307e0ee
6 changed files with 10 additions and 151 deletions

View File

@ -6,8 +6,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Threading;
using osu.Game.Extensions;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Volume
@ -17,18 +15,12 @@ namespace osu.Game.Overlays.Volume
public Func<GlobalAction, bool> ActionRequested;
public Func<GlobalAction, float, bool, bool> ScrollActionRequested;
private ScheduledDelegate keyRepeat;
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
switch (e.Action)
{
case GlobalAction.DecreaseVolume:
case GlobalAction.IncreaseVolume:
keyRepeat?.Cancel();
keyRepeat = this.BeginKeyRepeat(Scheduler, () => ActionRequested?.Invoke(e.Action), 150);
return true;
case GlobalAction.ToggleMute:
case GlobalAction.NextVolumeMeter:
case GlobalAction.PreviousVolumeMeter:
@ -41,7 +33,6 @@ namespace osu.Game.Overlays.Volume
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
{
keyRepeat?.Cancel();
}
protected override bool OnScroll(ScrollEvent e)