From 663728edca0a407546060a27f745a79660b6cb58 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Wed, 11 Sep 2019 09:08:05 -0400 Subject: [PATCH] Allow action names to be used in more than one action set at the same time. --- dll/steam_controller.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dll/steam_controller.h b/dll/steam_controller.h index 43305a03..b03dc572 100644 --- a/dll/steam_controller.h +++ b/dll/steam_controller.h @@ -145,7 +145,12 @@ public ISteamInput if (digital != button_strings.end()) { ControllerDigitalActionHandle_t digital_handle_num = current_handle_num; - digital_action_handles[config_key.first] = digital_handle_num; + if (digital_action_handles.find(config_key.first) == digital_action_handles.end()) { + digital_action_handles[config_key.first] = digital_handle_num; + } else { + digital_handle_num = digital_action_handles[config_key.first]; + } + controller_maps[action_handle_num].active_digital[digital_handle_num].insert(digital->second); } else { auto analog = analog_strings.find(button_string); @@ -164,7 +169,12 @@ public ISteamInput source_mode = input_mode->second; } - analog_action_handles[config_key.first] = analog_handle_num; + if (analog_action_handles.find(config_key.first) == analog_action_handles.end()) { + analog_action_handles[config_key.first] = analog_handle_num; + } else { + analog_handle_num = analog_action_handles[config_key.first]; + } + controller_maps[action_handle_num].active_analog[analog_handle_num].first.insert(analog->second); controller_maps[action_handle_num].active_analog[analog_handle_num].second = source_mode;