'Parse the keys and their command and store them in the object.'

def _parse_key_command(self, modename, key, cmd):

    if utils.is_special_key(key):
        keystr = utils.normalize_keystr(key[1:(-1)])
        self.special_bindings[keystr] = cmd
    elif self._supports_chains:
        self.bindings[key] = cmd
    elif self._warn_on_keychains:
        log.keyboard.warning("Ignoring    keychain    '{}'    in    mode    '{}'    because    keychains    are    not    supported    there.".format(key, modename))
