diff --git a/es-core/src/InputConfig.h b/es-core/src/InputConfig.h index 1ac7a6f6c..9f412c672 100644 --- a/es-core/src/InputConfig.h +++ b/es-core/src/InputConfig.h @@ -72,21 +72,31 @@ public: { std::stringstream stream; switch (type) { - case TYPE_AXIS: - stream << "Axis " << id << (value > 0 ? "+" : "-"); + case TYPE_AXIS: { + char signChar = ' '; + if (value > 0) + signChar = '+'; + else if (value < 0) + signChar = '-'; + stream << "Axis " << id << signChar; break; - case TYPE_BUTTON: + } + case TYPE_BUTTON: { stream << "Button " << id; break; - case TYPE_KEY: + } + case TYPE_KEY: { stream << "Key " << SDL_GetKeyName((SDL_Keycode)id); break; - case TYPE_CEC_BUTTON: + } + case TYPE_CEC_BUTTON: { stream << "CEC-Button " << getCECButtonName(id); break; - default: + } + default: { stream << "Input to string error"; break; + } } return stream.str(); diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index ffc5dcae9..043a141ae 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -254,7 +254,7 @@ void Window::logInput(InputConfig* config, Input input) } LOG(LogDebug) << "Window::logInput(" << config->getDeviceName() << "): " << - input.string() << ", isMappedTo=" << mapname << ", value=" << input.value; + input.string() << ", isMappedTo=" << mapname << "value=" << input.value; } void Window::update(int deltaTime)