1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 13:02:55 +08:00
osu-lazer/osu.Game/Screens/Play/KeyCounterKeyboard.cs
2017-01-27 21:57:22 +09:00

31 lines
904 B
C#

//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Input;
using OpenTK.Input;
namespace osu.Game.Screens.Play
{
public class KeyCounterKeyboard : KeyCounter
{
public Key Key { get; }
public KeyCounterKeyboard(string name, Key key) : base(name)
{
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);
}
}
}