def get_match(self, event_or_sequence, ignore=tuple()): q = event_or_sequence if isinstance(q, QKeyEvent): q = QKeySequence(q.key() | (int(q.modifiers()) & ~Qt.KeypadModifier)) for key in self.order: if key not in ignore: for seq in self.get_sequences(key): if seq.matches(q) == QKeySequence.ExactMatch: return key return None
def get_match(self, event_or_sequence, ignore=tuple()): q = event_or_sequence if isinstance(q, QKeyEvent): q = QKeySequence(q.key()|(int(q.modifiers()) & (~Qt.KeyboardModifier.KeypadModifier))) for key in self.order: if key not in ignore: for seq in self.get_sequences(key): if seq.matches(q) == QKeySequence.SequenceMatch.ExactMatch: return key return None