@@ -1008,7 +1008,7 @@ void QtSLiMAppDelegate::addActionsForGlobalMenuItems(QWidget *window)
10081008 }
10091009 {
10101010 QAction *actionShowDebuggingOutput = new QAction (" Show Debugging Output" , this );
1011- actionShowDebuggingOutput->setShortcut (flagsAndKey (Qt::ControlModifier, Qt::Key_D));
1011+ actionShowDebuggingOutput->setShortcut (flagsAndKey (Qt::ControlModifier | Qt::ShiftModifier , Qt::Key_D));
10121012 connect (actionShowDebuggingOutput, &QAction::triggered, qtSLiMAppDelegate, &QtSLiMAppDelegate::dispatch_showDebuggingOutput);
10131013 window->addAction (actionShowDebuggingOutput);
10141014 }
@@ -1080,6 +1080,12 @@ void QtSLiMAppDelegate::addActionsForGlobalMenuItems(QWidget *window)
10801080 connect (actionPaste, &QAction::triggered, qtSLiMAppDelegate, &QtSLiMAppDelegate::dispatch_paste);
10811081 window->addAction (actionPaste);
10821082 }
1083+ {
1084+ QAction *actionDuplicate = new QAction (" Duplicate" , this );
1085+ actionDuplicate->setShortcut (flagsAndKey (Qt::ControlModifier, Qt::Key_D));
1086+ connect (actionDuplicate, &QAction::triggered, qtSLiMAppDelegate, &QtSLiMAppDelegate::dispatch_duplicate);
1087+ window->addAction (actionDuplicate);
1088+ }
10831089 {
10841090 QAction *actionDelete = new QAction (" Delete" , this );
10851091 // actionDelete->setShortcut(flagsAndKey(Qt::ControlModifier, Qt::Key_V));
@@ -1495,6 +1501,15 @@ void QtSLiMAppDelegate::dispatch_paste(void)
14951501 plainTextEdit->paste ();
14961502}
14971503
1504+ void QtSLiMAppDelegate::dispatch_duplicate (void )
1505+ {
1506+ QWidget *focusWidget = QApplication::focusWidget ();
1507+ QtSLiMScriptTextEdit *scriptEdit = dynamic_cast <QtSLiMScriptTextEdit*>(focusWidget);
1508+
1509+ if (scriptEdit && scriptEdit->isEnabled () && !scriptEdit->isReadOnly ())
1510+ scriptEdit->duplicateSelection ();
1511+ }
1512+
14981513void QtSLiMAppDelegate::dispatch_delete (void )
14991514{
15001515 QWidget *focusWidget = QApplication::focusWidget ();
0 commit comments