def _match_key_mapping(self, sequence: keyutils.KeySequence) -> MatchResult: """Try to match a key in bindings.key_mappings.""" self._debug_log("Trying match with key_mappings") mapped = sequence.with_mappings( types.MappingProxyType(config.cache['bindings.key_mappings'])) if sequence != mapped: self._debug_log("Mapped {} -> {}".format(sequence, mapped)) return self._match_key(mapped) return MatchResult(match_type=QKeySequence.NoMatch, command=None, sequence=sequence)
def _match_without_modifiers( self, sequence: keyutils.KeySequence) -> MatchResult: """Try to match a key with optional modifiers stripped.""" self._debug_log("Trying match without modifiers") sequence = sequence.strip_modifiers() return self._match_key(sequence)