Handle unique edge case offered by '-option numpad:mac'#510
Open
jordansissel wants to merge 1 commit intomainfrom
Open
Handle unique edge case offered by '-option numpad:mac'#510jordansissel wants to merge 1 commit intomainfrom
jordansissel wants to merge 1 commit intomainfrom
Conversation
New test added. Typing tests pass.
In this case, the KEYPAD type deletes(?) its Level 1 by setting
`map[None] = 2` and `level_name[2] = "Number"` which appears to make
level_name[1] null.
The weird edge case here is that "no modifiersh" is mapped to a
non-level-1 shift level.
I confirmed this causes keypad keys to have their
key_type->level_names[0] == 0.
So now, levels with level_names[level] == 0 are skipped.
I also tried rewriting the keymap scanning code to be a little cleaner?
I removed the 'li == 0' shortcut because in this specific case, li==0 ("shift level
1") doesn't actually have any mappings and causes xdo to error when
trying to look up the level name! It's null! It has no name!
Fixes #507
Owner
Author
|
Since this PR changes how the keymap is processed, it's entirely possible that this fixes #507 while breaking something else. |
|
Can confirm the fix. I tried a few commands and didn't find any breakage so far. |
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.
New test added. Typing tests pass.
In this case, the KEYPAD type deletes(?) its Level 1 by setting
map[None] = 2andlevel_name[2] = "Number"which appears to makelevel_name[1] null.
The weird edge case here is that "no modifiers" is mapped to a
non-level-1 shift level. And further, that the level entry seems to just be deleted in the keymap, no name, no atom, etc.
I confirmed this causes keypad keys to have their
key_type->level_names[0] == 0.
So now, levels with level_names[level] == 0 are skipped.
I also tried rewriting the keymap scanning code to be a little cleaner?
I removed the 'li == 0' shortcut because in this specific case, li==0 ("shift level
1") doesn't actually have any mappings and causes xdo to error when
trying to look up the level name! It's null! It has no name!
Fixes #507