'Provide additional checks for accepting or rejecting shortcuts.'

def validate_sequence(self):

    if self.invalid_key_flag:
        self.update_warning(warning_type=INVALID_KEY)
        return
    for mod in MODIFIERS:
        non_mod = set(self.key_non_modifiers)
        non_mod.discard(mod)
        if (mod in self.key_non_modifiers):
            self.key_non_modifiers.remove(mod)
    self.key_modifiers = (self.key_modifiers - non_mod)
    while (u'' in self.key_text):
        self.key_text.remove(u'')
    self.key_text = [k.upper() for k in self.key_text]
    if (os.name == 'nt'):
        if (Qt.Key_Backtab in self.key_non_modifiers):
            idx = self.key_non_modifiers.index(Qt.Key_Backtab)
            self.key_non_modifiers[idx] = Qt.Key_Tab
    if (len(self.key_modifiers) == 0):
        if (self.key_non_modifiers[0] not in VALID_SINGLE_KEYS):
            return
        elif (len(self.key_non_modifiers) > 1):
            return
    if (len(self.keys) > 4):
        self.update_warning(warning_type=SEQUENCE_LENGTH)
        return
    keys = []
    for i in range(len(self.keys)):
        key_seq = 0
        for m in self.key_modifiers:
            key_seq += MODIFIERS[m]
        key_seq += self.key_non_modifiers[i]
        keys.append(key_seq)
    sequence = QKeySequence(*keys)
    self.set_sequence(sequence.toString())
