diff options
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5bc38b9..1e08f0f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -151,6 +151,23 @@ void MainWindow::mouseDoubleClickEvent(QMouseEvent *) } } +void MainWindow::keyPressEvent(QKeyEvent *event) +{ + switch (event->key()) { + case Qt::Key_Escape: + if (m_Snake != nullptr) { + delete m_Snake; + m_Snake = nullptr; + } + break; + case Qt::Key_Pause: + if (m_Snake != nullptr) { + m_Snake->pauseAndResume(); + } + break; + } +} + QSize MainWindow::createLogo(QRect max) { QSize retval(0, 0); |