diff options
author | Steffen Ritter | 2019-07-10 10:38:55 +0200 |
---|---|---|
committer | Steffen Ritter | 2019-07-10 10:38:55 +0200 |
commit | 971b4523cceaf7b4972301cea203375137790986 (patch) | |
tree | 56c5260e0a1828d6d70d9b5cabf2d0605e6d2bb0 /src/mainwindow.cpp | |
parent | Prevent infinite loop (diff) | |
download | slxgreeter-971b4523cceaf7b4972301cea203375137790986.tar.gz slxgreeter-971b4523cceaf7b4972301cea203375137790986.tar.xz slxgreeter-971b4523cceaf7b4972301cea203375137790986.zip |
Handle special keys
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); |