code: def keyPressEvent(self, event):
          "press ESCAPE to quit the application"
          key = event.key()
          if key == Qt.Key_Escape:
              self.app.quit(f keyPressEvent(self, event):
          "press ESCAPE to quit the application"
          key = event.key()
          if key == Qt.Key_Escape:
              self.app.quit()
docs: press ESCAPE to quit the application