Virtual keys only work as last item on match side?

Have they always worked this way?

I just noticed this morning if I use a virtual key code then + then another keystroke, the rule does not work. Isn’t it supposed to?

In my test, the first rule works, the second one does not. Is this new?

'`' + [K_BKQUOTE] > 'backtick backtick' 
[K_BKQUOTE] + 'a' > 'backtick a' 

I have Keyman and Keyman Developer 15.0.274.

The 2nd rule can’t fire because you’ve already converted [K_BKQUOTE] into something else in the first rule.

The second rule will not work even if the first one is removed.

On the left side of the rule, the items to the left of the + are characters, whereas the item to the right of + is a keystroke, which can be expressed either as [K_XXXX] or a character which is interpreted as a key code.

Oh, right. The left side of the + is context and the right side is the keystroke.

Yes, I can see that in the manual now that I know to look for it.


Virtual keys are used in the key section of a rule. Virtual keys are not valid in the context of a rule, as the context consists solely of characters.


See also bug report: bug: Keyman Developer does not flag virtual keycodes in context string as an error · Issue #7880 · keymanapp/keyman · GitHub

And yes, @lorna is correct. rule is made up of three parts:

context + keystroke > output

The context consists of characters already in the document, so a keystroke makes no logical sense in that part of the rule. (Note, while the idea of emitting a keystroke to the active application is not illogical, we don’t support that either :slight_smile:)