Make Pause hotkey Shift+Space (#5554)

This commit is contained in:
Kumar
2020-07-06 21:07:27 +05:30
committed by GitHub
parent c83c9bf54f
commit fd04efd394
2 changed files with 9 additions and 0 deletions

View File

@@ -58,6 +58,9 @@ protected slots:
private slots:
/// Called by pressing the space key. Plays or stops.
void togglePlayStop();
/// Called by pressing shift+space. Toggles pause state.
void togglePause();
signals:

View File

@@ -74,6 +74,11 @@ void Editor::togglePlayStop()
play();
}
void Editor::togglePause()
{
Engine::getSong()->togglePause();
}
Editor::Editor(bool record, bool stepRecord) :
m_toolBar(new DropToolBar(this)),
m_playAction(nullptr),
@@ -104,6 +109,7 @@ Editor::Editor(bool record, bool stepRecord) :
connect(m_toggleStepRecordingAction, SIGNAL(triggered()), this, SLOT(toggleStepRecording()));
connect(m_stopAction, SIGNAL(triggered()), this, SLOT(stop()));
new QShortcut(Qt::Key_Space, this, SLOT(togglePlayStop()));
new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Space), this, SLOT(togglePause()));
// Add actions to toolbar
addButton(m_playAction, "playButton");