1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 03:57:25 +08:00
osu-lazer/osu.Game/Input/GlobalHotkeys.cs

26 lines
688 B
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics;
using osu.Framework.Input;
namespace osu.Game.Input
{
public class GlobalHotkeys : Drawable
{
public Func<InputState, KeyDownEventArgs, bool> Handler;
public override bool HandleInput => true;
public GlobalHotkeys()
{
RelativeSizeAxes = Axes.Both;
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
return Handler(state, args);
}
}
}