From 960b406477c202584db93fecaf6187bf4355d108 Mon Sep 17 00:00:00 2001 From: Cem Aksoylar Date: Wed, 27 Mar 2024 20:29:06 -0700 Subject: [PATCH] fix: Handle `0xff` layers value in ZMK combos parsing Commonly used e.g. in nodefree-config: https://github.com/urob/zmk-nodefree-config/blob/973f717/helper.h#L65 --- keymap_drawer/parse/zmk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keymap_drawer/parse/zmk.py b/keymap_drawer/parse/zmk.py index 6294583..3086c90 100644 --- a/keymap_drawer/parse/zmk.py +++ b/keymap_drawer/parse/zmk.py @@ -194,7 +194,7 @@ def _get_combos(self, dts: DeviceTree) -> list[ComboSpec]: ) from err combo = {"k": parsed_key, "p": key_pos} - if layers := node.get_array("layers"): + if (layers := node.get_array("layers")) and layers[0].lower() != "0xff": combo["l"] = [self.layer_names[int(layer)] for layer in layers] # see if combo had additional properties specified in the config, if so merge them in