diff options
author | Lisandro Lorea <lisandrolorea@gmail.com> | 2024-07-25 00:35:05 -0300 |
---|---|---|
committer | Lisandro Lorea <lisandrolorea@gmail.com> | 2024-08-14 16:13:16 -0300 |
commit | 9dd372f3164f3daf01c02d1f4ba304ffde47f394 (patch) | |
tree | 9ca0396a9a4760bd6f6c62ca8a0446fc8a15ef03 /modules/regex/regex.cpp | |
parent | 8e666adeed99328fda02e47429c8e45f36cd5ae1 (diff) | |
download | redot-engine-9dd372f3164f3daf01c02d1f4ba304ffde47f394.tar.gz |
Fix gamepad triggers not working on web exports
Fixes #81758
DisplayServerWeb::process_joypads handles buttons 6 and 7 of the
HTML5 Standard Gamepad as a special case by doing:
`input->joy_axis(idx, (JoyAxis)b, s_btns[b]);`
This doesn't work because there is no JoyAxis 6 or 7 in the enum
To fix this we use JoyAxis::TRIGGER_LEFT and TRIGGER_RIGHT for button 6
and 7
However since we are now lying to input->joy_axis we also need to lie in
the mappings for the standard gamepad in godotcontrollersdb.txt,
otherwise input->joy_axis will try to find a mapping to axis 4(LT) and
axis 5(RT) that's not defined.
Therefore we set lefttrigger to +a4 and righttrigger to +a5 in the
mapping, to match what we are actually sending.
A cleaner, and more involved fix to this would be modifying
input->joy_button so that it can handle analog buttons and map them to
axes preserving their value instead of converting to boolean
Diffstat (limited to 'modules/regex/regex.cpp')
0 files changed, 0 insertions, 0 deletions