Qt::KeyboardModifiers kbrdMod = qApp->keyboardModifiers(); bool ctrlPresed = (kbrdMod & Qt::ControlModifier) ? true : false;
qDebug() << "ctrlPresed = true; key: " << key <<" nativeScanCode " <<event->nativeScanCode () << " text " << event->text() <<" nativeVirtualKey: "<< event->nativeVirtualKey();
C++ (Qt)void MainWindow::keyPressEvent(QKeyEvent *e){ if (e->key() == Qt::Key_C && e->modifiers() & Qt::ControlModifier) { qDebug() << "Ctrl+C pressed!"; } if (e->key() == Qt::Key_V && e->modifiers() & Qt::ControlModifier) { qDebug() << "Ctrl+V pressed!"; } QMainWindow::keyPressEvent(e);}