2017-02-07 04:59:30 +00: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 09:45:48 +00: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 06:22:14 +00:00
|
|
|
|
public Action<InputState> ActionRequested;
|
2016-10-26 09:45:48 +00:00
|
|
|
|
|
2016-11-06 07:25:21 +00:00
|
|
|
|
protected override bool OnWheel(InputState state)
|
2016-10-26 09:45:48 +00:00
|
|
|
|
{
|
2016-11-15 06:22:14 +00:00
|
|
|
|
ActionRequested?.Invoke(state);
|
2016-10-26 09:45:48 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
switch (args.Key)
|
|
|
|
|
{
|
|
|
|
|
case Key.Up:
|
|
|
|
|
case Key.Down:
|
2016-11-15 06:22:14 +00:00
|
|
|
|
ActionRequested?.Invoke(state);
|
2016-10-26 09:45:48 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return base.OnKeyDown(state, args);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|