From ca771f6218ba34fee64dd293d622d3f49f1fb356 Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Mon, 9 Apr 2018 19:28:22 -0400 Subject: [PATCH] Cleanup input.xml file (remove unused properties in some cases), add a little inline doc to make it a little easier to customize --- src/input/binding.cpp | 10 +++++++--- src/input/device_manager.cpp | 12 ++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/input/binding.cpp b/src/input/binding.cpp index 595adc6a8..aa1880fc4 100644 --- a/src/input/binding.cpp +++ b/src/input/binding.cpp @@ -29,9 +29,13 @@ */ void Binding::save(std::ofstream& stream) const { - stream << "id=\"" << m_id << "\" " - << "event=\"" << m_type << "\" " - << "character=\"" << m_character << "\" "; + stream << "event=\"" << m_type << "\" "; + stream << "id=\"" << m_id << "\" "; + + if (m_type == Input::IT_KEYBOARD) + { + stream << "character=\"" << m_character << "\" "; + } // Only serialize the direction and the range for stick motions if (m_type == Input::IT_STICKMOTION) diff --git a/src/input/device_manager.cpp b/src/input/device_manager.cpp index 4ca09160b..50bf27c8f 100644 --- a/src/input/device_manager.cpp +++ b/src/input/device_manager.cpp @@ -643,6 +643,18 @@ void DeviceManager::save() configfile << "\n\n"; + configfile << "\n\n"; + for(unsigned int n=0; n