void Keymap::saveMappings() { if (!_configDomain) return; List<Action *>::const_iterator it; String prefix = KEYMAP_KEY_PREFIX + _name + "_"; for (it = _actions.begin(); it != _actions.end(); ++it) { uint actIdLen = strlen((*it)->id); actIdLen = (actIdLen > ACTION_ID_SIZE) ? ACTION_ID_SIZE : actIdLen; String actId((*it)->id, (*it)->id + actIdLen); String hwId = ""; if ((*it)->getMappedInput()) { hwId = (*it)->getMappedInput()->id; } _configDomain->setVal(prefix + actId, hwId); } }
void Keymap::saveMappings() { if (!_configDomain) return; List<Action*>::const_iterator it; String prefix = KEYMAP_KEY_PREFIX + _name + "_"; for (it = _actions.begin(); it != _actions.end(); ++it) { uint actIdLen = strlen((*it)->id); actIdLen = (actIdLen > ACTION_ID_SIZE) ? ACTION_ID_SIZE : actIdLen; String actId((*it)->id, (*it)->id + actIdLen); char hwId[HWKEY_ID_SIZE+1]; memset(hwId, 0, HWKEY_ID_SIZE+1); if ((*it)->getMappedKey()) { memcpy(hwId, (*it)->getMappedKey()->hwKeyId, HWKEY_ID_SIZE); } _configDomain->setVal(prefix + actId, hwId); } }