diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2016-10-15 17:55:15 +0200 |
---|---|---|
committer | Andreas Haas <liu.gam3@gmail.com> | 2016-10-15 17:55:15 +0200 |
commit | fa502b7ccc1859b7d75dac841036eda6bff5210d (patch) | |
tree | e64183fce64935d1f0517bb01bd8f0fb690ce035 | |
parent | eb8d19ba740c11acf0f26080405fc5cd827a2d41 (diff) |
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 ,"
-rw-r--r-- | main/input_default.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index 92f4a6fb72..c60fcd2243 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -1050,8 +1050,8 @@ void InputDefault::parse_mapping(String p_mapping) { if (entry[idx] == "") continue; - String from = entry[idx].get_slice(":", 1); - String to = entry[idx].get_slice(":", 0); + String from = entry[idx].get_slice(":", 1).replace(" ", ""); + String to = entry[idx].get_slice(":", 0).replace(" ", ""); JoyEvent to_event = _find_to_event(to); if (to_event.type == -1) |