Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Geobert
Copy link
Collaborator

@Geobert Geobert commented Nov 17, 2024

This avoid "Too many OEM" because of empty keys. Now we exit if such a key is detected

This avoid "Too many OEM" because of empty keys. Now we exit if such a
key is detected
Copy link
Collaborator

@fabi1cazenave fabi1cazenave left a 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.

@@ -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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise Exception("Empty key are not allowed, please complete the description")
raise Exception("Empty keys are not allowed, please complete the description")

Copy link
Collaborator

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.

Copy link
Collaborator Author

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants