// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Input.Events; using osu.Framework.Input.States; namespace osu.Framework.Input { public class MidiKeyEventManager : ButtonEventManager { public MidiKeyEventManager(MidiKey button) : base(button) { } protected override Drawable HandleButtonDown(InputState state, List targets) => PropagateButtonEvent(targets, new MidiDownEvent(state, Button, state.Midi.Velocities[Button])); protected override void HandleButtonUp(InputState state, List targets) { if (targets == null) return; PropagateButtonEvent(targets, new MidiUpEvent(state, Button)); } } }