diff --git a/gtk2_ardour/pianokeyboard.cc b/gtk2_ardour/pianokeyboard.cc index ae508fdd7a..5a17a35ee1 100644 --- a/gtk2_ardour/pianokeyboard.cc +++ b/gtk2_ardour/pianokeyboard.cc @@ -642,6 +642,15 @@ APianoKeyboard::on_key_press_event (GdkEventKey* event) return true; } + std::map::const_iterator kv = _note_stack.find (key); + if (kv != _note_stack.end ()) { + /* key is already pressed, ignore event. + * this can happen when changing the octave with the mouse + * while playing. + */ + return true; + } + note += _octave * 12; assert (key);