Expose joypad vendor_id and product_id in Windows#91539
Closed
Rubonnek wants to merge 1 commit intogodotengine:masterfrom
Closed
Expose joypad vendor_id and product_id in Windows#91539Rubonnek wants to merge 1 commit intogodotengine:masterfrom
vendor_id and product_id in Windows#91539Rubonnek wants to merge 1 commit intogodotengine:masterfrom
Conversation
f741400 to
644ee91
Compare
Member
|
If there's already the API and it's implemented only on Linux, I guess it makes sense to add it for Windows too, yeah. FTR, there's also #89193 which tries to move the parsing to the engine, which should address the above usecase in a more solid way hopefully. |
Contributor
|
The recently merged PR #98861 did some related stuff, but used the |
Member
Author
|
Closing since #98861 superseded this PR and the exposed data for the hardware I have available are the same in both PRs. |
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.
The
vendor_idandproduct_idcan already be extracted but only in Linux. It was implemented back in #78539 throughInput.get_joy_info(device_id)and this PR implements the same functionality but for Windows.I should add that through the XInput API the
vendor_idandproduct_idextraction happens through an undocumented function in XInput1_4.dll which is the same way SDL does it.This PR is inspired by the following proposal:
Input.get_joy_type()to get controller type godot-proposals#8519I was looking for a way to map a joypad to its type in order to correctly show button prompts and by reading through the proposal one can find the following databases which allow users to do so:
The reason I didn't implement
Input.get_joy_type()is because I don't think the function nor those databases should be compiled into the engine. The joypad type database needs could differ greatly between users, and once thevendor_idandproduct_idcan be extracted with ease, the mapping of a joypad to its type seems straightforward through an addon.