2017-02-07 12:59:30 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-10-26 17:45:48 +08:00
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Input;
|
|
|
|
|
using OpenTK.Input;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.UserInterface.Volume
|
|
|
|
|
{
|
|
|
|
|
class VolumeControlReceptor : Container
|
|
|
|
|
{
|
2016-11-15 14:22:14 +08:00
|
|
|
|
public Action<InputState> ActionRequested;
|
2016-10-26 17:45:48 +08:00
|
|
|
|
|
2016-11-06 15:25:21 +08:00
|
|
|
|
protected override bool OnWheel(InputState state)
|
2016-10-26 17:45:48 +08:00
|
|
|
|
{
|
2016-11-15 14:22:14 +08:00
|
|
|
|
ActionRequested?.Invoke(state);
|
2016-10-26 17:45:48 +08:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
switch (args.Key)
|
|
|
|
|
{
|
|
|
|
|
case Key.Up:
|
|
|
|
|
case Key.Down:
|
2016-11-15 14:22:14 +08:00
|
|
|
|
ActionRequested?.Invoke(state);
|
2016-10-26 17:45:48 +08:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return base.OnKeyDown(state, args);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|