From 64386de482d665f62c031ff7d06cf4add5ffa05b Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Sun, 24 Feb 2019 21:57:53 -0500 Subject: [PATCH] Add needed macOS shortcuts (#4851) Fix insert bars, delete bars, delete notes on Apple keyboard --- src/gui/editors/AutomationEditor.cpp | 1 + src/gui/editors/PianoRoll.cpp | 1 + src/gui/editors/SongEditor.cpp | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 0234be0ab72..06eece23acf 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -404,6 +404,7 @@ void AutomationEditor::keyPressEvent(QKeyEvent * ke ) } break; + case Qt::Key_Backspace: case Qt::Key_Delete: deleteSelectedValues(); ke->accept(); diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 7bdf9dc077c..fef788885db 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -1184,6 +1184,7 @@ void PianoRoll::keyPressEvent(QKeyEvent* ke ) clearSelectedNotes(); break; + case Qt::Key_Backspace: case Qt::Key_Delete: deleteSelectedNotes(); ke->accept(); diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index f3b69e47dd5..286b01f15c3 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -315,13 +315,13 @@ void SongEditor::keyPressEvent( QKeyEvent * ke ) { if( /*_ke->modifiers() & Qt::ShiftModifier*/ gui->mainWindow()->isShiftPressed() == true && - ke->key() == Qt::Key_Insert ) + ( ke->key() == Qt::Key_Insert || ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) ) { m_song->insertBar(); } else if(/* _ke->modifiers() & Qt::ShiftModifier &&*/ gui->mainWindow()->isShiftPressed() == true && - ke->key() == Qt::Key_Delete ) + ( ke->key() == Qt::Key_Delete || ke->key() == Qt::Key_Backspace ) ) { m_song->removeBar(); }