Exemple #1
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            if (selectedIndex >= 0)
            {
                velocities[selectedIndex] = 0;
                if (VelocityChanged != null)
                {
                    VelocityChanged.Invoke(this, new KeyInputEvent {
                        Note = selectedIndex + offset, Velocity = velocities[selectedIndex]
                    });
                }

                PianoKeyUp?.Invoke(this, new KeyInputEvent {
                    Note = selectedIndex + offset
                });

                Invalidate();
            }
            base.OnMouseUp(e);
        }
Exemple #2
0
 protected virtual void OnPianoKeyUp(PianoKeyEventArgs e)
 {
     PianoKeyUp?.Invoke(this, e);
 }