Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions kalamine/generators/klc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 ^^'

else:
MAX_OEM = 9
# We affect abitrary OEM VK and it will not match the one
Expand Down