From 1a8f177526a12607d8933150ddb6b29d5e2912fc Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:42:52 +0100 Subject: [PATCH] Added mouse parameter parsing --- src/input/input_handler.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/input/input_handler.cpp b/src/input/input_handler.cpp index 6a54d233cd..77bd1c34cd 100644 --- a/src/input/input_handler.cpp +++ b/src/input/input_handler.cpp @@ -204,7 +204,19 @@ void parseInputConfig(const std::string game_id = "") { continue; } if (output_string == "mouse_movement_params") { - LOG_DEBUG(Input, "todo: {}", line); + std::stringstream ss(input_string); + char comma; // To hold the comma separators between the floats + ss >> mouse_deadzone_offset >> comma + >> mouse_speed >> comma + >> mouse_speed_offset; + + // Check for invalid input (in case there's an unexpected format) + if (ss.fail()) { + LOG_ERROR(Input, "Failed to parse mouse movement parameters from line: {}", line); + } else { + //LOG_DEBUG(Input, "Mouse movement parameters parsed: {} {} {}", mouse_deadzone_offset, mouse_speed, mouse_speed_offset); + } + continue; }