diff --git a/game.py b/game.py index c1c181c..ef08083 100644 --- a/game.py +++ b/game.py @@ -54,6 +54,11 @@ class SeopardyGame(QtGui.QWidget): self.setLayout(layout) + def keyPressEvent(self, e): + print("Mainwindow", e) + if e.key() == QtCore.Qt.Key_Escape: + self.close() + def tfunc(self, section, number): print("question window", section, number) diff --git a/windows.py b/windows.py index deedbf5..d7b67e9 100644 --- a/windows.py +++ b/windows.py @@ -48,3 +48,7 @@ class QuestionWindow(QtGui.QDialog): self.setLayout(self.layout) + def keyPressEvent(self, e): + print("question", e, e.key()) + if e.key() == QtCore.Qt.Key_Escape: + self.close()