Skip to content

[Gamepad] Remove default gamepad axis deadzone on MacOS/GLFW #4405

@dmg46664

Description

@dmg46664

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

  1. 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.
  2. 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:

  1. 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.
  2. An API that allows settings a single setting across all controller axis in game.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions