Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with Input.get_joy_guid and Input.add_joy_mapping #39157

Closed
n3rdw1z4rd opened this issue May 30, 2020 · 6 comments · Fixed by #39172
Closed

Issues with Input.get_joy_guid and Input.add_joy_mapping #39157

n3rdw1z4rd opened this issue May 30, 2020 · 6 comments · Fixed by #39172

Comments

@n3rdw1z4rd
Copy link
Contributor

n3rdw1z4rd commented May 30, 2020

Godot version: v3.2.1.stable.official
OS: macOS Catalina v10.15.5
Other: SDL Gamepad Tool v2.0.7

Issue description:
While using SDL Gamepad Tool, I noticed the GUID (from tool) is different than what is returned by Input.get_joy_guid():

Tool: "Xbox One Wired Controller", 03000000c62400003a54000000000000
Godot: "Xbox One Wired Controller", c6240000000000003a54000000000000

I first noticed this when attempting to use Input.add_joy_mapping because it was not working. After replacing the GUID with what Godot returns in Input.get_joy_guid, it did work, but:

Input.add_joy_mapping seems to ignore the ~ for inverting an axis, as in: lefty:a1~

Steps to reproduce (Input.get_joy_guid):

  1. Download SDL Gamepad Tool v2.0.7.
  2. Run Gamepad Tool with a gamepad connected (usb or bluetooth both work with the same results).
  3. Note the device GUID in the output window, just below "Found 1 gamepad(s):".
  4. In Godot, create a script that prints Input.get_joy_guid(0).
  5. Observe the Godot GUID differs from the SDL Gamepad Tool GUID.

Steps to reproduce (Input.add_joy_mapping):

  1. Run Gamepad Tool again and click Create A New Mapping.
  2. Go through the steps to create a a new mapping.
  3. Click Copy Mapping String.
  4. In Godot, in the script created from above, paste the string from the Gamepad Tool.
  5. Replace the GUID supplied from the Gamepad Tool with the GUID returned from Godot.
  6. In the mapping string, locate lefty:a1 (the value may not be a1), insert a ~ just after a1 so that it looks like: lefty:a1~.
  7. Program a simple player-controller using Input Actions that utilize the left stick Y axis.
  8. Observe the axis is not inverted as it should with a ~ present.
  9. Be sure to test without the ~ as well.

Minimal reproduction project:
JoyGUIDAndMappingIssue.zip

@madmiraal
Copy link
Contributor

Related to #38869, which was specific to Windows.

Note: The lack of inverted axis mapping support is a duplicate of #8368, which was fixed with #38151.

@n3rdw1z4rd
Copy link
Contributor Author

n3rdw1z4rd commented May 30, 2020

My apologies @madmiraal, I did search for similar issues, but didn't find those you mentioned.

@n3rdw1z4rd
Copy link
Contributor Author

I built Godot from the master branch (commit 0f1da72) and the inverted axis is working as expected.

The GUID (returned by Input.get_joy_guid is still not the same as the SDL Gamepad Tool, or core/input/gamecontrollerdb.txt

@n3rdw1z4rd
Copy link
Contributor Author

Closing this issue as it is being addressed in #39172

@madmiraal
Copy link
Contributor

This issue will be closed automatically when #39172 is merged. In the meantime, it should remain open; so others can find it.

@madmiraal madmiraal reopened this Jun 1, 2020
@n3rdw1z4rd
Copy link
Contributor Author

Oh, my apologies :)

@akien-mga akien-mga added this to the 4.0 milestone Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants