1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Allow whitespace in Gamepad mappings.

Previously, mappings that contained whitespace (most likely after a comma seperator) would not parse
correctly.
Consider the following mapping as an example:

"_test_guid_, test controller, a:b0, b:b1, leftx:a0 ,"

(cherry picked from commit fa502b7ccc)
This commit is contained in:
Andreas Haas
2016-10-15 17:55:15 +02:00
committed by Rémi Verschelde
parent 9b71cae50f
commit 64b083b496

View File

@@ -995,8 +995,8 @@ void InputDefault::parse_mapping(String p_mapping) {
if (entry[idx] == "") if (entry[idx] == "")
continue; continue;
String from = entry[idx].get_slice(":", 1); String from = entry[idx].get_slice(":", 1).replace(" ", "");
String to = entry[idx].get_slice(":", 0); String to = entry[idx].get_slice(":", 0).replace(" ", "");
JoyEvent to_event = _find_to_event(to); JoyEvent to_event = _find_to_event(to);
if (to_event.type == -1) if (to_event.type == -1)