From 84c58666a4dbb6d46e132514e4d91437fb689fa0 Mon Sep 17 00:00:00 2001 From: german77 Date: Wed, 3 Nov 2021 22:35:45 -0600 Subject: config: Cleanup and documentation --- src/core/hid/emulated_console.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/hid/emulated_console.cpp b/src/core/hid/emulated_console.cpp index dfbaa3f8c..b51c72eae 100644 --- a/src/core/hid/emulated_console.cpp +++ b/src/core/hid/emulated_console.cpp @@ -11,7 +11,7 @@ EmulatedConsole::EmulatedConsole() = default; EmulatedConsole::~EmulatedConsole() = default; void EmulatedConsole::ReloadFromSettings() { - // Using first motion device from player 1. No need to assign a special config at the moment + // Using first motion device from player 1. No need to assign any unique config at the moment const auto& player = Settings::values.players.GetValue()[0]; motion_params = Common::ParamPackage(player.motions[0]); @@ -33,6 +33,7 @@ void EmulatedConsole::SetTouchParams() { static_cast(Settings::values.touch_from_button_map_index.GetValue()); const auto& touch_buttons = Settings::values.touch_from_button_maps[button_index].buttons; + // Map the rest of the fingers from touch from button configuration for (const auto& config_entry : touch_buttons) { Common::ParamPackage params{config_entry}; Common::ParamPackage touch_button_params; @@ -54,7 +55,9 @@ void EmulatedConsole::SetTouchParams() { } void EmulatedConsole::ReloadInput() { + // If you load any device here add the equivalent to the UnloadInput() function SetTouchParams(); + motion_devices = Common::Input::CreateDevice(motion_params); if (motion_devices) { Common::Input::InputCallback motion_callback{ @@ -62,6 +65,7 @@ void EmulatedConsole::ReloadInput() { motion_devices->SetCallback(motion_callback); } + // Unique index for identifying touch device source std::size_t index = 0; for (auto& touch_device : touch_devices) { touch_device = Common::Input::CreateDevice(touch_params[index]); -- cgit v1.2.3