zmkfirmware / zmk-studio

Apache License 2.0
84 stars 18 forks source link

compiler error with: mods = <(MOD_RCMD|MOD_LCMD)>; but no error with mods = <(MOD_RGUI|MOD_LGUI)>; #74

Closed ladcash closed 2 weeks ago

ladcash commented 2 weeks ago

Describe the bug

  1. mod-morph definitions using RCMD & LCMD keycodes: ...mods = <(MOD_RCMD|MOD_LCMD)>; fail to compile with error message: "devicetree error: /tmp/zmk-config/config/corne.keymap:49 (column 185): parse error: expected number or parenthesized expression.", where the line number is correct, the column number has no relationship to the error source, & the only clue as to the source is in the kconfig device tree file: "dtu: d_to_up { compatible = "zmk,behavior-mod-morph"; #binding-cells = <0>; bindings = <&kp ((((0x07) << 16) | (0x07)))>, <&kp (((((0x07) << 16) | (0x52))))>; mods = <(MOD_LCMD|MOD_RCMD)>; };."
  2. the Keymap Upgrader identifies no problems with LCMD/RCMD
  3. the identical code lines using RGUI & LGUI keycodes: ...mods = <(MOD_RGUI|MOD_LGUI)>; compiles perfectly.

To Reproduce Steps to reproduce the behavior:

  1. Compile: h2l: h_to_left { compatible = "zmk,behavior-mod-morph"; #binding-cells = <0>; bindings = <&kp H>, <&kp LEFT>; mods = <(MOD_RCMD|MOD_LCMD)>; };
  2. See error

Expected behavior obvious

Screenshots not applicable

Environment (please complete the following information):

Additional context

caksoylar commented 2 weeks ago

I think you opened this in the wrong repo, maybe you meant to open in https://github.com/zmkfirmware/zmk ?

caksoylar commented 2 weeks ago

FWIW, the mod flags are not necessarily the same as modifier keycodes. The list is documented at https://zmk.dev/docs/keymaps/behaviors/mod-morph#mods and it doesn't include MOD_*CMD as valid flags.

ladcash commented 2 weeks ago

Thanks!! Cem,

It’s worth a lot – the right answer always is. I sped past this mods list in the mod-morph section & assumed that the same keycode is sent with platform interpretation differences. This seems to be the case as all of my mod-morphs with GUIs work perfectly.

Be Excellent, Michael

From: Cem Aksoylar @.> Reply-To: zmkfirmware/zmk-studio @.> Date: Sunday, November 3, 2024 at 9:07 PM To: zmkfirmware/zmk-studio @.> Cc: ladcash @.>, Author @.***> Subject: Re: [zmkfirmware/zmk-studio] compiler error with: mods = <(MOD_RCMD|MOD_LCMD)>; but no error with mods = <(MOD_RGUI|MOD_LGUI)>; (Issue #74)

FWIW, the mod flags are not necessarily the same as modifier keycodes. The list is documented at https://zmk.dev/docs/keymaps/behaviors/mod-morph#mods and it doesn't include MOD_*CMD as valid flags.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>