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

echec de wkalamine avec l’option angle-mod #172

Closed
nemolivier opened this issue Apr 18, 2024 · 2 comments · Fixed by #174
Closed

echec de wkalamine avec l’option angle-mod #172

nemolivier opened this issue Apr 18, 2024 · 2 comments · Fixed by #174

Comments

@nemolivier
Copy link

nemolivier commented Apr 18, 2024

béop-némo.txt
La compilation d’un .toml avec l’option angle.mod plante avec ce message d’erreur :

Creating MSKLC driver for `béop-némo` █████████████∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ 42%Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "c:\users\olivier\.local\bin\wkalamine.exe\__main__.py", line 7, in <module>
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\kalamine\cli_msklc.py", line 61, in build
    if msklc_mgr.build_msklc_dll():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\kalamine\msklc_manager.py", line 179, in build_msklc_dll
    file.write(klc.klc(self._layout))
               ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\kalamine\generators\klc.py", line 384, in klc
    out = substitute_lines(out, "LAYOUT",         klc_keymap(layout))
                                                  ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\kalamine\generators\klc.py", line 139, in klc_keymap
    virtual_key = klc_virtual_key(layout, symbols, scan_code)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Olivier\AppData\Local\pipx\pipx\venvs\kalamine\Lib\site-packages\kalamine\generators\klc.py", line 91, in klc_virtual_key
    raise Exception("Too many OEM keys")
Exception: Too many OEM keys

Pas d’erreur si pas utilisation de l’option angle-mod.

@Ced-C
Copy link
Contributor

Ced-C commented Apr 18, 2024

Bug Confirmed with the latest version of kalamine.
it seems that the --angle-mod option is not compatible with the MAX_OEM = 8 by setting the variable to 9 it fixes the bug for me at least.

But that might not be the intended behaviour.

@fabi1cazenave, I think you wrote this part, is kalamine/generators/klc.py:50,54

    if scan_code == "56":
        # 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
        return "OEM_102"

Compatible with the angle-mod permutation? Should we deal with it here or increase the MAX_OEM value to 9 upon angle-mod ?

Advise needed 😅

In any case, I am surprised this passed the unit tests.

@Geobert
Copy link
Contributor

Geobert commented May 7, 2024

increase the MAX_OEM value to 9 upon angle-mod ?

can’t do that, it’s not defined http://kbdedit.com/manual/low_level_vk_list.html

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 a pull request may close this issue.

3 participants