Skip to content

Commit

Permalink
fix: angle mod failure (#174)
Browse files Browse the repository at this point in the history
* fix: angle mod failure
* chore: remove debug print leftover
  • Loading branch information
Geobert committed Jul 22, 2024
1 parent 173ff65 commit 015422f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 015422f

Please sign in to comment.