Skip to content

Commit

Permalink
Fix controller binds
Browse files Browse the repository at this point in the history
  • Loading branch information
Axanery authored and Lactozilla committed Sep 18, 2024
1 parent eccbe6a commit 808646b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/Engine/InputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@ PRIVATE STATIC void InputManager::ParseDefaultInputBinds(InputPlayer& player, in
XMLNode* child = node->children[i];

if (XMLParser::MatchToken(child->name, "key")) {
const char* keyName = child->children[0]->name.ToString().c_str();
std::string keyNameStr = child->children[0]->name.ToString();
const char* keyName = keyNameStr.c_str();
int key = ParseKeyName(keyName);
if (key != Key_UNKNOWN) {
KeyboardBind* bind = new KeyboardBind(key);
Expand All @@ -1101,7 +1102,8 @@ PRIVATE STATIC void InputManager::ParseDefaultInputBinds(InputPlayer& player, in
}
}
else if (XMLParser::MatchToken(child->name, "button")) {
const char* buttonName = child->children[0]->name.ToString().c_str();
std::string buttonNameStr = child->children[0]->name.ToString();
const char* buttonName = buttonNameStr.c_str();
int button = ParseButtonName(buttonName);
if (button != -1) {
ControllerButtonBind* bind = new ControllerButtonBind(button);
Expand All @@ -1113,7 +1115,8 @@ PRIVATE STATIC void InputManager::ParseDefaultInputBinds(InputPlayer& player, in
}
}
else if (XMLParser::MatchToken(child->name, "axis")) {
const char* axisName = child->children[0]->name.ToString().c_str();
std::string axisNameStr = child->children[0]->name.ToString();
const char* axisName = axisNameStr.c_str();

int axisID;
if (axisName[0] == '-' || axisName[0] == '+')
Expand Down

0 comments on commit 808646b

Please sign in to comment.