Search code examples
keymankeyman-developer

Keyman "The keyboard file is an old version" and other errors/warnings with Keyman CLI?


I used AI to help me learn Keyman, and resulted in making this:

c My Fantasy Script Keyboard
store(&VERSION) '1.0'
store(&NAME) 'My Fantasy Script'
store(&BITMAP) 'fntsy.ico'
store(&LAYOUTFILE) 'fntsy.kmn'
store(&TARGETS) 'windows macosx linux web'

begin Unicode > use(main)

group(main) using keys
+ '0' > U+00A1 c Mapping for the '0' key
+ '1' > U+00A6 c Mapping for the '1' key
+ '2' > U+00A2 c Mapping for the '2' key
+ '3' > U+00A3 c Mapping for the '3' key
+ '4' > U+00A5 c Mapping for the '4' key
+ '5' > U+00A4 c Mapping for the '5' key
+ '6' > U+00A9 c Mapping for the '6' key
+ '7' > U+00A7 c Mapping for the '7' key
+ '8' > U+00AB c Mapping for the '8' key
+ '9' > U+00AE c Mapping for the '9' key

What am I doing wrong?

Why do I get this output when running this command (installing @keymanapp/kmc)?

$ kmc build --color --debug fntsy.kmn
fntsy.kmn - info KM05002: Building fntsy.kmn
fntsy.kmn:2 - warn KM02081: The keyboard file is an old version
fntsy.kmn:2 - error KM0200D: Invalid 'version' command
fntsy.kmn - info KM05007: fntsy.kmn failed to build.

How do I fix this? There documentation is quite hard to follow and find solutions to, so I'm probably using the wrong version of the file format (though I couldn't find the right one or what's wrong with mine), and the invalid version is throwing me off too.

Update:

Changing the version to reference Keymans version (not my language version) seems to get past that:

store(&VERSION) '17.0'

But now I get a host of these warnings:

fntsy.kmn:11 - warn KM02084: There are too many characters in the keystroke part of the rule.
fntsy.kmn:12 - warn KM02084: There are too many characters in the keystroke part of the rule.

I have rules like this, what's wrong?

group(main) using keys
+ 'I$&--@_^' [K_TAB] > 'I%9440005' c Mapping for the 'I$&--@_^' key, the vowel i with stress, lengthening, tense, stress, nasalization and extra low tone
+ 'I$&-@_^' [K_TAB] > 'I%940005' c Mapping for the 'I$&-@_^' key, the vowel i with stress, lengthening, tense, stress, nasalization and low tone
+ 'I$&++@_^' [K_TAB] > 'I%9330005' c Mapping for the 'I$&++@_^' key, the vowel i with stress, lengthening, tense, stress, nasalization and extra high tone
+ 'I$&+@_^' [K_TAB] > 'I%930005' c Mapping for the 'I$&+@_^' key, the vowel i with stress, lengthening, tense, stress, nasalization and high tone

Solution

  • The store(&VERSION) '1.0' refers to the version of the Keyman language. Leave it out and the compiler will (almost always) figure it out.

    If you want to give your keyboard a version, use store(&KEYBOARDVERSION) '1.0'

    Keyboard rules are written with a context (optional), a "+" sign, a single keystroke, a ">" and the resulting characters or actions. Output characters are Unicode characters: 'a' or "a" or U+0061 are equivalent forms. It's not clear to me what keystrokes and characters you are attempting to use in your rules