Skip to content

Input class not handling Switch Pro Controller joystick axis properly #37675

Closed
@raulboo

Description

@raulboo

Godot version:
v3.2.1.stable.official

OS/device including version:
Windows 10 Home 1903

Issue description:
Using only the Nintendo Switch Pro Controller analog sticks, whenever I request Input.get_joy_axis(0, JOYSTICK_AXIS_* ) or Input.get_action_strength("ui_*"), where "ui_*" was assigned to one of the left analog stick directions on the input map ("ui_up" -> Device 0, Axis 1 -; "ui_down" -> Device 0, Axis 1 +; ...) I only recieve discrete values. That is, the values I get are floats, but rounded ones, such that negative values round to -1 and positive value round to 1. The result is an input system only able to utilize 4 input vectors : (1, 1); (1, -1); (-1, 1); (-1, -1). As so, for instance, a character with this input configuration would only be able to move diagonally.

Also, because the values recieved are rounded up, there is no way to calculate a deadzone, so the controls twitch randomly on game even when they are supposed to be centered, as they are never 100% centered.

I tested this on a Xbox Controller, and all results came as expected, that is, the values are floats between -1 and 1 representing the right "strength" of input on the analog sticks. Also, the fault isn't on my particular controller, as the sensitivity of the analog is working on Switch and PC games.

Steps to reproduce:

  1. Grab a Nintendo Switch Pro Controller and connect it Bluetooth-wise on your PC
  2. Execute the code on the _process() function of a Node:
print(Vector2(Input.get_joy_axis(0,JOY_ANALOG_LX),  Input.get_joy_axis(0,JOY_ANALOG_LY)),
	Vector2(Input.get_joy_axis(0,JOY_ANALOG_RX),  Input.get_joy_axis(0,JOY_ANALOG_RY)))
  1. Mess around with both analogs and check results

Minimal reproduction project:
ProControllerBug.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions