Fixes dpad to analog being interrupted by mouse movement input to resolve #1515 #1529
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.
This is my attempt to fix the problem of the dpad interruption whenever the mouse report movement input. The issue lies in the preprocess_report function. Inside it uses a function to zero out the dpad input, no doubt useful when keyboard input is pressed, however the mouse_report() also uses it when updating right analog input and thus both dpad to left analog and mouse right analog cannot be used at the same time (extremely useful for mapping first-person shooters, to gyro controls on Switch). I have included Pelsin's updated code and moved the dpad zero function to the line after the preprocess call on kbd_report() and it seems to have fixed the problem.
However, I believe this need testing as I'm not sure of potential conflicts, or edge-cases that might arise from this change in code. I'm only pull requesting it so that others might test it, or help in fixing this. Currently, I have tested it very limitedly on both PC and Switch.