How to use the ahk.keys.KeyCombo function in ahk

To help you get started, we’ve selected a few ahk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spyoungtech / ahk / ahk / keys.py View on Github external
def __add__(self, other):
        if self._s is not None:
            raise ValueError('Key combo is already terminated')
        if isinstance(other, KeyCombo):
            combo = KeyCombo(*[*self.modifiers, *other.modifiers])
            if other._s:
                combo = combo + other._s
            return combo
        if isinstance(other, KeyModifier):
            self.modifiers.append(other)
        elif isinstance(other, Key) or isinstance(other, str):
            self._s = str(other)
            return self
        else:
            raise TypeError(f"unsupported operand type(s) for +: '{self.__class__.__name__}' and '{type(other)}'")
github spyoungtech / ahk / ahk / keys.py View on Github external
def __add__(self, other):
        if isinstance(other, KeyModifier):
            return KeyCombo(self, other)
        elif isinstance(other, KeyCombo):
            return other + self

        return self.symbol + str(other)
github spyoungtech / ahk / ahk / keys.py View on Github external
def __add__(self, other):
        if isinstance(other, KeyModifier):
            return KeyCombo(self, other)
        elif isinstance(other, KeyCombo):
            return other + self

        return self.symbol + str(other)