-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Please, before submitting a new issue verify and check:
- I tested it on latest raylib version from master branch
- I checked there is no similar issue already reported
- I checked the documentation on the wiki
- My code has no errors or misuse of raylib
Issue description
Edit: The following sentence isn't relevant as it was misdiagnosed: Raylib expects a compile time constant to set the deadzone
Raylib does not appear to have an API to set the deadzone of a controller, yet it exists and is defaulted on the GLFW backend on MacOS.
This should be up to the user in game as
- Gamepads with HALL-effect sensors may have zero drift, and users will be hamstrung by arbitrary drift. This may be needed for FPSs and simulator games requiring precision control.
- Users with older potentiometer controllers may have larger drift amounts that need to be manually set.
In order to accommodate this an API is required for setting the dead-zone independently for each controller axis, of each gamepad.
In addition hard coding this requires recompilation of the library if used by JS, Python or other scripting wrapper (I'm using Vybe), preventing the wrapper from hosting "it just works out the box" compiled version of Raylib in their library.
Solutions in ascending order of difficulty:
- A stepping stone solution would simply be to default it 0.0 which would allow all games to handle this in game code. Solves for wrappers.
- An API that allows settings a single setting across all controller axis in game.
- An API that allows setting for each hardware axis independently for each controller (this properly models reality of user's controllers).
No expectations, just posting to start a discussion. Thanks for the library :-)
Environment
Platform backend: DESKTOP (GLFW) on MacOS
Issue Screenshot
N/A
Code Example
In issue description.