Code for key-handling
This commit is contained in:
parent
3e47a87192
commit
7d79d47cc3
5
game.py
5
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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue