2016-09-23 18:57:19 +08:00
|
|
|
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using OpenTK.Input;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Input;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.UserInterface
|
|
|
|
|
{
|
2016-09-24 14:28:59 +08:00
|
|
|
|
public class KeyCounterKeyboard : KeyCounter
|
2016-09-23 18:57:19 +08:00
|
|
|
|
{
|
|
|
|
|
public Key Key { get; }
|
2016-09-24 14:28:59 +08:00
|
|
|
|
public KeyCounterKeyboard(string name, Key key) : base(name)
|
2016-09-23 18:57:19 +08:00
|
|
|
|
{
|
|
|
|
|
Key = key;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
if (args.Key == this.Key) IsLit = true;
|
|
|
|
|
return base.OnKeyDown(state, args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
if (args.Key == this.Key) IsLit = false;
|
|
|
|
|
return base.OnKeyUp(state, args);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|