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); }
protected virtual void OnPianoKeyUp(PianoKeyEventArgs e) { PianoKeyUp?.Invoke(this, e); }