Add back support for custom buttons to control analog inputs

This commit is contained in:
Henrik Rydgård 2023-05-08 10:46:28 +02:00
parent e078f61bad
commit 9623f515e7
2 changed files with 3 additions and 1 deletions

View file

@ -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);

View file

@ -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.