keyman icon indicating copy to clipboard operation
keyman copied to clipboard

bug(developer): kmc does not support `<key gap>` or implied keys 🙀

Open srl295 opened this issue 3 years ago • 2 comments

Three ldml keyboards that fail to compile. Will be attached to PR

Looks like the issues are:

  • keys without to= are not supported, which means gaps and switches are not supported.
  • the default keys <key id="a" to="a"/> are not supported and must be put in explicitly

srl295 avatar Oct 04 '22 19:10 srl295

trying this patch out… basically, making the 'gap' etc be a 0-length string

diff --git a/common/web/types/src/kvk/kvk-file-writer.ts b/common/web/types/src/kvk/kvk-file-writer.ts
index 78a484284..701b538b4 100644
--- a/common/web/types/src/kvk/kvk-file-writer.ts
+++ b/common/web/types/src/kvk/kvk-file-writer.ts
@@ -50,7 +50,11 @@ export default class KvkFileWriter {
         text: { len: 0, str: '' },
         bitmap: 0
       };
-      this.setString(binaryKey.text, sourceKey.text);
+      if (sourceKey.text) {
+        this.setString(binaryKey.text, sourceKey.text);
+      } else {
+        this.setString(binaryKey.text, '');
+      }
       binary.keys.push(binaryKey);
     }

srl295 avatar Oct 04 '22 20:10 srl295

actually one of the issues, elsewhere, was a non-gap key with no to (oops)

    <key id="space" width="5" />

so perhaps on !sourceKey.text it should check if it's a gap, etc. and fail if to is missing AND it's not a gap or switch.

srl295 avatar Oct 04 '22 20:10 srl295

gap is coming in in #7630 implied keys will be imports and will come in in #7534

srl295 avatar Dec 09 '22 02:12 srl295