From 120aa968b279af392f9f2c55af1b797c93dd48b7 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Tue, 25 Jan 2022 15:50:20 -0500 Subject: [PATCH] Fixed game that uses the digital handle function to get analog handles. --- dll/steam_controller.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dll/steam_controller.h b/dll/steam_controller.h index abf1d69..abed1c9 100644 --- a/dll/steam_controller.h +++ b/dll/steam_controller.h @@ -563,7 +563,11 @@ ControllerDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionNam std::transform(upper_action_name.begin(), upper_action_name.end(), upper_action_name.begin(),[](unsigned char c){ return std::toupper(c); }); auto handle = digital_action_handles.find(upper_action_name); - if (handle == digital_action_handles.end()) return 0; + if (handle == digital_action_handles.end()) { + //apparently GetDigitalActionHandle also works with analog handles + handle = analog_action_handles.find(upper_action_name); + if (handle == analog_action_handles.end()) return 0; + } PRINT_DEBUG("Steam_Controller::GetDigitalActionHandle %s ret %llu\n", pszActionName, handle->second); return handle->second;