any (KA) (Deprecated)
(Deprecated) Returns whether or not the char
ch is found within the
string, setting the internally-tracked index 'n' accordingly.
keyman.interface.any(index, ch, storeText);
KeymanWeb.KA(index, ch, storeText); // Shorthand
- The index id (starting from zero) at which the detected character will be internally tracked.
- The input character to find in the text store.
- The contents of the specified text
trueif the input character has a match in the text store, otherwise
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
keyman.interface.any()'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
above, the code
keyman.interface.any(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
keyman.interface.indexOutput() call increments the id by
1 due to Keyman's keyboard language rules.