def toggle_key(self, key_str): self.set_key(key_str, state=-1) self.active_sequence = QtGui.QKeySequence()