-
Notifications
You must be signed in to change notification settings - Fork 29
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(klc): avoid empty keys #196
base: main
Are you sure you want to change the base?
Conversation
This avoid "Too many OEM" because of empty keys. Now we exit if such a key is detected
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.
Looks like a working fix, but this is an opportunity to improve the AHK-related codebase.
kalamine/generators/klc.py
Outdated
@@ -81,6 +81,8 @@ def klc_virtual_key(layout: "KeyboardLayout", symbols: list, scan_code: str) -> | |||
return "OEM_MINUS" | |||
elif base == " ": | |||
return "SPACE" | |||
elif base == "-1" and shifted == "-1": | |||
raise Exception("Empty key are not allowed, please complete the description") |
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.
raise Exception("Empty key are not allowed, please complete the description") | |
raise Exception("Empty keys are not allowed, please complete the description") |
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.
This section confusing. Where do these "-1" come from? This doesn’t seem sane to me. :-)
The exception message could be more self-explanatory. What should be completed?
And while we’re at it, the "too many OEM keys" message could be a bit better as well.
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 don’t know where the -1
comes from, isn’t it filled by the toml
parser?
"Too many OEM" is not very clear indeed, do you have a better idea? I don’t have any ^^'
Co-authored-by: Fabien Cazenave <[email protected]>
This avoid "Too many OEM" because of empty keys. Now we exit if such a key is detected