kmc-convert provides tooling to convert between various common keyboard description file formats. Each conversion will be implemented in its single, separate module (and each module will done in its own PR) This PR will address the conversion **keylayout → kmn** Co-authored-by: Marc Durdin <marc@durdin.net> |
||
|---|---|---|
| .. | ||
| dtd | ||
| create_keylayout_schema.sh | ||
| keylayout.schema.json | ||
| readme.md | ||
Keylayout
A keylayout file is a configuration file used macOS to define custom keyboard mappings, mapping physical key presses to specific characters or Unicode symbols. These XML-based files, created with Ukelele, allow users to create custom layouts for different languages or special haracters, such as mapping Option + Key combinations. With kmc-convert we can convert these keylayout files to .kmn files which can be used in Keyman keyboards. For validating a .keylayout file a keylayout.schema.json is needed.
This is to get a keylayout.schema.json:
-
We first need to have a
.XSD filecreated from a.keylayout file(which is an xml-file type )e.g. resources\standards-data\keylayout\dtd\keylayout.xsd -
Then we need to run
./create_keylayout_schema.shto obtain a.schema.jsonfilee.g resources\standards-data\keylayout\create_keylayout_schema.sh -
Then we need to run
build.sh configureofcommon/web/types/which will create aschema.validate.mjsfilee.g. common/web/types/build.sh configure -
The .mjs can then be used via
SchemaValidatorsto validate keylayout filese.g. SchemaValidators.default.keylayout(source)