urob / zmk-helpers

Convenience macros simplifying ZMK's keymap configuration
MIT License
235 stars 79 forks source link

Unable to use international helper #31

Closed lou-bi closed 9 months ago

lou-bi commented 9 months ago

I have a tried a few things, but nothing work for now. I am on Windows 11, using a nice!nanov2 Corne 42 keys.

First try: macros are printed on screen but not the char. Second try: I use WinCompose but it does not solves the problem. Third try: I set the HOST_OS variable to 2. Now macros are not printed, but nothing is at all. When not on an input field, I have a typical Windows sound, but I don't really know which shortcut it is trying to do.

Here is a snippet with relevant code from my config:

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>

#define HOST_OS 2 // To use "press LALT"

#include "../zmk-nodefree-config/helper.h"
#include "../zmk-nodefree-config/keypos_def/keypos_42keys.h"              // keyposition helpers
#include "../zmk-nodefree-config/international_chars/french.dtsi"

...

/ {
   keymap {
      compatible = "zmk,keymap";

         ...

         accents {
            bindings = <
___ ___              ___             &fr_ae          &fr_oe        ___              /**/ ___ ___ ___ ___ ___ ___
___ &fr_a_circumflex &fr_a_grave     &fr_e_grave     &fr_e_acute   &fr_e_circumflex /**/ ___ ___ ___ ___ ___ ___
___ &fr_o_circumflex &fr_i_diaeresis &fr_e_diaeresis &fr_c_cedilla ___              /**/ ___ ___ ___ ___ ___ ___
                                                                        ___ ___ ___ /**/ ___ ___ ___
            >;
         };
   };
};

Link to my config in case it helps : https://github.com/lou-bi/zmk-config/blob/8130b7838f5ea5f3f71ea4a0fea252d06ca8b821/config/corne.keymap#L82

Sorry if its just a huge nooby problem, already solved, and that i just didn't try hard enough.

urob commented 9 months ago

For WinCompose you should set HOST_OS to 0 (the default). You should also check that WinCompose is using RALT as compose key (again, this is the default) and that it is running.

I do not recommend using the windows-native Alt-keys. First, they only work in a select few apps. Second, and more importantly, alt-key codes are not the same as unicodes. So you would need to edit the french language file and adjust all the codes.

lou-bi commented 9 months ago

Ok I see. I need to rewrite the french.dtsi file then because I see, for example, that a_grave use 0+0+E+0, but in the wincomposer documentation, the sequence seems to be "a+`".

urob commented 9 months ago

Those are unicode sequences. If you have Wincompose installed the bundled french.dtsi files should work. Make sure you have unicode enabled though:

image

lou-bi commented 9 months ago

Thanks, working now ! Advanced unicode input was already checked, so I did uncheck the last three checkboxes.

While I'm here, thanks a lot for this repo. As a new comer in ergo split, it helps a TON !!