godot/platform
Lisandro Lorea 9dd372f316 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
2024-08-14 16:13:16 -03:00
..
android Android: Ensure cleanup of all subobjects in the OpenSL audio driver 2024-07-30 17:20:46 +02:00
ios [iOS] Fix dylib GDExtension convertion. 2024-08-09 12:44:48 +03:00
linuxbsd Wayland: Avoid recreating input objects on capability change 2024-08-09 15:42:23 +02:00
macos [macOS] Fix wrong object type in joypad queue. 2024-08-12 14:09:18 +03:00
web Fix gamepad triggers not working on web exports 2024-08-14 16:13:16 -03:00
windows Merge pull request #95155 from bruvzg/win_pen_checks 2024-08-06 12:32:02 +02:00
SCsub Update pre-commit hooks configuration to use `ruff` instead of `black` 2024-05-21 18:02:29 -05:00
register_platform_apis.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00