def lookup_key(self, key: config.Key | config.KeyChord) -> tuple[int, int]:
        """Find the keysym and the modifier mask for the given key"""
        if isinstance(key.key, str):
            keysym = xcbq.keysyms.get(key.key.lower())
            if not keysym:
                raise utils.QtileError(f"Unknown keysym: {key.key}")

        else:
            keysym = self.conn.code_to_syms[key.key][0]
            if not keysym:
                raise utils.QtileError(f"Unknown keycode: {key.key}")

        modmask = xcbq.translate_masks(key.modifiers)

        return keysym, modmask
Find the keysym and the modifier mask for the given key
libqtile/backend/x11/core.py