Fix bug: Shift modifier incorrectly added to filter shortcuts #3999
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.
Description:
See above issue for problem description.
Summary / conclusions
This terrifying block of code appears to be the culprit:
The value it returns will always be in uppercase, which is fine for display purposes, but it shouldn't have been using it to store the "raw" key value (The code was already grabbing the raw value from the user and putting it in
currentKey
, and it was far simpler to just use that). It has another problem: it seems to add 3 null characters to the string it returns. The debugger shows thatt
is stored asT\0\0\0
.This is not good, but I'm going to punt and declare it to be outside the scope of this defect.
After this fix,
readableKeyDescription
is only used in two places:FilterWindowController
for display. At least this doesn't seem to be breaking anything.KeyCodeHelper.mpvKeyCode()
, where it is checked for inequality against another string, causing a block of code to always evaluate totrue
- which is ok because that block should always be executed.This should be cleaned up at some point. Rather than try to debug that block, a more prudent solution would be to remove all use of it and find a simpler substitute if needed. At least this PR makes strides in that direction.