'Key release event for non-edit state.'

def nonedit_keyrelease(self, e):

    key = e.key()
    if (key in [Qt.Key_Escape]):
        self.close()
        return
    if (key in [Qt.Key_Left, Qt.Key_Right, Qt.Key_Up, Qt.Key_Down]):
        if self.button_ok.hasFocus():
            self.button_cancel.setFocus()
        else:
            self.button_ok.setFocus()
