Code for key-handling

This commit is contained in:
Sebastian Lohff 2013-11-07 01:19:50 +01:00
parent 3e47a87192
commit 7d79d47cc3
2 changed files with 9 additions and 0 deletions

View File

@ -54,6 +54,11 @@ class SeopardyGame(QtGui.QWidget):
self.setLayout(layout) self.setLayout(layout)
def keyPressEvent(self, e):
print("Mainwindow", e)
if e.key() == QtCore.Qt.Key_Escape:
self.close()
def tfunc(self, section, number): def tfunc(self, section, number):
print("question window", section, number) print("question window", section, number)

View File

@ -48,3 +48,7 @@ class QuestionWindow(QtGui.QDialog):
self.setLayout(self.layout) self.setLayout(self.layout)
def keyPressEvent(self, e):
print("question", e, e.key())
if e.key() == QtCore.Qt.Key_Escape:
self.close()