Repository navigation
Give each GLFW gamepad slot its own device path - #224
Merged
Merged
Conversation
On Windows all XInput pads have the same GLFW GUID, and two pads of the same model have the same GUID on any platform. The second pad got the device of the first one, so both pads sent input as one device. Add the joystick slot to the hardware path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ce9wNPVavgwzJKqdHkMLQR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GlfwInputDeviceInterface::ConnectGamepadmade the device'sHardwarePathfrom the GLFW joystick GUID only. On Windows, GLFW gives every XInput pad the same GUID (78696e707574..., which is xinput plus a subtype, with no slot number). On every platform, two pads of the same model also have the same GUID.InputDeviceFactory::CreateDevicereturns the connected device that has the same interface, type, VID/PID and path. So the second pad got the device of the first pad:InputDeviceIdFix
Add the GLFW joystick slot to the path:
glfw:<guid>:<slot>. A pad that connects again in the same slot still gets its old ID.Testing (Windows, MSVC / VS 2022, Debug)
clang-formatpass.glfw:78696e70757401000000000000000000:0and sends axis messages.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ce9wNPVavgwzJKqdHkMLQR