-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fix Input::remove_joy_mapping
#98792
Conversation
0c33bde
to
42f5514
Compare
Input::remove_joy_mapping
42f5514
to
fd8aa95
Compare
fd8aa95
to
ce6fae4
Compare
ce6fae4
to
556f90b
Compare
8a92f94
to
18bce29
Compare
Erasing a joypad mapping can invalidate other attached joypads and the fallback mapping guid
18bce29
to
4083238
Compare
status update:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it easier and more intuitive to record the old index than to calculate it. There is nothing wrong with the logic.
086a11b
to
f7c6a86
Compare
@MJacred Things are more complicated than I initially thought. Especially in the case of being between the minimum removal index and the maximum removal index. For example, suppose that more than three indexes are removed, and there is another guid between the minimum removed index and the maximum removed index, and the guid has multiple mipping records.
Using simple variables is not enough to record these shifts. To do this, we may need to record all of the mapping indexes of the |
@Rindbee: I think I got it. Alternatively, I can iterate over EDIT: fixed syntax check failure and typo EDIT 2: did a comparison with original commit, and the differences are
|
ae692f3
to
cd0bc6e
Compare
cd0bc6e
to
f355382
Compare
92b860a
to
b5012c7
Compare
b5012c7
to
8e75fae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no problem with the logic and it is relatively clear.
Thanks! |
Erasing a joypad mapping can invalidate other attached joypads and the fallback mapping guid
Fixes #91257 (cannot confirm crash on Linux. Untested on Windows where it was observed)
If this PR is merged, it needs to be cherry-picked/backported to all supported Godot versions, afaik.
NOTE
I'm not sure if I handledfallback_mapping
correctly, because according toInput::is_joy_known
the fallback does not count as a known device… Therefore, feedback on this would be niceIf it's only meant as an internal fallback, a more minimal change of this PR to the fallback logic would be to deny removing the mapping for that one. Then I could remove the setter and getter for the fallback.-> Removed bindingsI renamed some members in windows joypad file to differentiate between direct INPUT and direct X. I found-> Renaming is done in another PRd_joypads
, and it feels like thed_
prefix was meant as a direct input abbreviation. So I used that. I'm open to alternative naming convention, though. Some renaming should happen to untangle INPUT and X.