def handler_key(event): if event.key.keyval == Gdk.KEY_Escape: return QuitLoop('Escape key', event) return None