Keyman warning "There are too many characters in the keystroke part of the rule." How to fix?

Cross-posting Keyman “Invalid ‘version’ command” and other warnings/errors, how to fix? from StackOverflow, doesn’t look like there is much activity on SO regarding keyman.

Getting this:

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

https://help.keyman.com/developer/18.0/reference/messages/km02084

Also for completeness, I am getting this error at the end of this:

fntsy.kmn - error KM07003: Invalid touch layout file: SyntaxError: Unexpected token 'c', "c Tone Tex"... is not valid JSON

At the end of this:

c Tone Text Keyboard
store(&VERSION) '17.0'
store(&NAME) 'Tone Text'
store(&BITMAP) 'tone.ico'
store(&LAYOUTFILE) 'tone.kmn'
store(&TARGETS) 'windows macosx linux web'

begin Unicode > use(main)

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

Well, I joined StackOverflow so that I could respond to your question, but this really is a better forum.

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.

Can you give an example of one Unicode character (or sequence of Unicode characters) and the keystrokes you want to type to obtain that result? Note that the context (before the “+” on the left-hand side of the “>”) is in terms of characters that have already been produced, and the keystroke (between the “+” and the “>”) is a key that is typed.

@drowe thank you for quickly responding and taking the time. I figured out the error, but perhaps this helps other Googlers.

+ 'I$&--@' [K_TAB] > 'I%9440005'

Should become:

'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 put the + at the beginning of the line instead of before the [K_TAB]. It works now!

1 Like

The &LAYOUTFILE store references a touch layout description file, but you have it referencing the .kmn source file (thanks AI!?). See &layoutfile