bool AxisFromPspButton(int btn, int *deviceId, int *axisId, int *direction) { for (auto iter = g_controllerMap.begin(); iter != g_controllerMap.end(); ++iter) { for (auto iter2 = iter->second.begin(); iter2 != iter->second.end(); ++iter2) { if (iter->first == btn && iter2->keyCode >= AXIS_BIND_NKCODE_START) { *deviceId = iter2->deviceId; *axisId = TranslateKeyCodeToAxis(iter2->keyCode, *direction); return true; } } } return false; }
std::string GetKeyOrAxisName(int keyCode) { if (keyCode >= AXIS_BIND_NKCODE_START) { int direction; int axis = TranslateKeyCodeToAxis(keyCode, direction); std::string temp = GetAxisName(axis); if (direction == 1) temp += "+"; else if (direction == -1) temp += "-"; return temp; } return FindName(keyCode, key_names, ARRAY_SIZE(key_names)); }