Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 2.0

On this page

KCM

Summary

Context matching: Returns true if KC(n,ln,elem) == val.

Syntax

KeymanWeb.KCM(n, Pelem, val, ln);

Parameters

n
Type: number
Relative position of the caret for the context match attempt.
Pelem
Type: Element
The element being operated upon.
val
Type: string
The desired text value for context to match.
ln
Type: number
Number of characters of text context to match.

Return Value

boolean
true if the context matches the specified value val, otherwise false.

Description

This is a core element of keyboard input management within KeymanWeb, typically called automatically during keystroke processing events. For comparison with Developer 'rules' from keyboard source code, in the rule

"a" + "'" > "รก"

a keyboard would check that the initial context ("a") matches by using

KeymanWeb.KCM(1, Pelem, "a", 1)

which checks, starting at the first character to the left of the caret, a single character to see if it matches the value "a".

See also

KeymanWeb.KC(), KeymanWeb.KO(), KeymanWeb.KKM()