Penjin::ERRORS KeyMapper::mapMouse(CRuchar id) { Penjin::ERRORS result = PENJIN_OK; string device = "Mouse"; vector<string> keyList = getKeys(device); for(uint i = 0; i < keyList.size(); ++i) { KeyMap* t = NULL; if(keyList.at(i).find("Button") != keyList.at(i).npos) { t = new KeyMapMouseButton(Penjin::StringUtility::stringToInt(getValue(device,keyList.at(i))), keyList.at(i), id); } else { t = new KeyMapMouseAxis(Penjin::StringUtility::stringToInt(getValue(device,keyList.at(i))), keyList.at(i), id); } if(t == NULL) result = PENJIN_ERROR; else if(t->isMapValid()) { keys.push_back(t); } else { ErrorMan::getInstance()->print(PENJIN_ERROR, "KeyMapper::mapMouse(): "); delete t; result = PENJIN_ERROR; // We have to show that something went wrong with the config } } return result; }