def keyPressEvent(self, event):
        key = event.key()

        if key in self.keymap:
            self.keymap[key]()
        else:
            super(MenuDialog, self).keyPressEvent(event)
Handle keyboard events
dataset/ETHPy150Open tuturto/pyherc/src/herculeum/ui/gui/menu.py/MenuDialog.keyPressEvent