Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 17.0 (home page)Version 16.0 (home page, current version)Version 15.0 (home page)Version 14.0 (home page)Version 13.0 (home page)Version 12.0 (home page)Version 11.0 (home page)Version 10.0 (home page)Version 2.0Version 1.0 (home page)

On this page

KA

Summary

Returns whether or not the char ch is found within the any(store) string, setting the internally-tracked index 'n' accordingly.

Syntax

KeymanWeb.KA(index, ch, any);

Parameters

index
Type: number
The index id (starting from zero) at which the detected character will be internally tracked.
ch
Type: string
The input character to find in the text store.
any
Type: string
The contents of the specified text store.

Return Value

boolean
true if the input character has a match in the text store, otherwise false.

Description

This function corresponds most directly to the keyboard language command any, which operates upon text stores to allow for array-based input-output text matching. For example,

store(keys)   'abcde'
store(output) 'αβγδε'
+ any(keys) > index(output,1)

facilitates mapping the characters 'abcde' to their respective entry in the output store 'αβγδε'. KeymanWeb.KA()'s role in this process is usually optimized out into individual mappings for performance reasons, though it is often involved when any is involved as part of a rule's context, rather than upon the triggering keystroke itself.

In order to check if the character 'a' has a match in the keys store above, the code

KeymanWeb.KA(0, 'a', 'abcde')

would suffice, setting an internally-tracked index (id=0) to hold the index value 0. Note that the internally-tracked index (id=0) is decremented relative to the index appearing in the index call in the keyboard source above; the corresponding KeymanWeb.KIO() call increments the id by 1 due to Keyman's keyboard language rules.

See also

KeymanWeb.KIO()