From 9623f515e735cfa546ed067ea7a6c0087b47aadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 8 May 2023 10:46:28 +0200 Subject: [PATCH] Add back support for custom buttons to control analog inputs --- Core/ControlMapper.cpp | 2 ++ Core/ControlMapper.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/ControlMapper.cpp b/Core/ControlMapper.cpp index 49f3d0c3e..07945a02c 100644 --- a/Core/ControlMapper.cpp +++ b/Core/ControlMapper.cpp @@ -504,10 +504,12 @@ void ControlMapper::PSPKey(int deviceId, int pspKeyCode, int flags) { if (flags & KEY_DOWN) { virtKeys_[vk] = 1.0f; onVKey(pspKeyCode, true); + onVKeyAnalog(deviceId, pspKeyCode, 1.0f); } if (flags & KEY_UP) { virtKeys_[vk] = 0.0f; onVKey(pspKeyCode, false); + onVKeyAnalog(deviceId, pspKeyCode, 0.0f); } } else { // INFO_LOG(SYSTEM, "pspKey %d %d", pspKeyCode, flags); diff --git a/Core/ControlMapper.h b/Core/ControlMapper.h index 6ebef3a76..bca32ff0e 100644 --- a/Core/ControlMapper.h +++ b/Core/ControlMapper.h @@ -29,7 +29,7 @@ public: // Inject raw PSP key input directly, such as from touch screen controls. // Combined with the mapped input. Unlike __Ctrl APIs, this supports - // virtual key codes, though not analog mappings. + // virtual key codes, including analog mappings. void PSPKey(int deviceId, int pspKeyCode, int flags); // Toggle swapping DPAD and Analog. Useful on some input devices with few buttons.