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: angle mod failure #174

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 5 additions & 2 deletions kalamine/generators/klc.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ def _get_langid(locale: str) -> str:


def klc_virtual_key(layout: "KeyboardLayout", symbols: list, scan_code: str) -> str:
if scan_code == "56":
oem_102_scan_code = "56"
if layout.angle_mod:
oem_102_scan_code = "30"
if scan_code == oem_102_scan_code:
# manage the ISO key (between shift and Z on ISO keyboards).
# We're assuming that its scancode is always 56
# https://www.win.tue.nl/~aeb/linux/kbd/scancodes.html
Expand Down Expand Up @@ -79,7 +82,7 @@ def klc_virtual_key(layout: "KeyboardLayout", symbols: list, scan_code: str) ->
elif base == " ":
return "SPACE"
else:
MAX_OEM = 8
MAX_OEM = 9
# We affect abitrary OEM VK and it will not match the one
# in distributed layout. It can cause issue if a application
# is awaiting a particular OEM_ for a hotkey
Expand Down
2 changes: 2 additions & 0 deletions kalamine/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def __init__(
self.has_altgr = False
self.has_1dk = False
self.qwerty_shortcuts = qwerty_shortcuts
self.angle_mod = angle_mod

# metadata: self.meta
for k in layout_data:
Expand Down Expand Up @@ -174,6 +175,7 @@ def __init__(
click.echo(
"Warning: geometry does not support angle-mod; ignoring the --angle-mod argument"
)
self.angle_mod = False

if "full" in layout_data:
full = text_to_lines(layout_data["full"])
Expand Down
Loading