Output Functions - the Keyboard API
The KeymanWeb core object window.tavultesoft.keymanweb
also exposes a number of functions for low-level processing of input, context and output. These functions are
designed for use by keyboards compiled through Keyman Developer in order to facilitate input text processing and will
also work for custom-coded KeymanWeb keyboards. As such, most of these functions should only be called by keyboard code,
and a good understanding of the Keyman Keyboard Language will prove extremely beneficial
toward understanding the keyboard API functions enumerated in this section.
Custom user interfaces would not normally use these functions, but they are described here as some custom keyboards, such as IME-style keyboards, may need to interact with the user interface.
KAFunction- Returns whether or not the char
chis found within theany(store) string, setting the internally-tracked index 'n' accordingly.
KBFunction- Flash body or element as substitute for an audible feedback
beep.
KBRFunction- Cancels a previous feedback
beepoperation on a page element.
KCFunction- Gets
contextfor an ongoing keyboard operation relative to the caret's present position.
KCMFunction- Context matching: Returns
trueifKC(n,ln,elem) == val.
KDMFunction- Deadkey matching: Seeks to match the
deadkeystatedkat the relative caret positionn.
KDOFunction- Deadkey output: Associates the
deadkeystatedkwith the element at the current caret position, after overwritingndcharacters.
KIFSFunction- KIFS compares the content of a system
storewith a string value.
KIKFunction- Returns
trueif the input event corresponds to a keypress event resulting in character output.
KIOFunction- Index-based output: Outputs a mapped character according to a previous selection from a
KeymanWeb.KA()call upon astorestring, after deletingndcharacters.
KKIFunction- Returns an object with extended information about a specified keystroke event.
KKMFunction- Keystroke matching: Returns
trueif the event matches the rule's shift mask and key code.
KLOADFunction- Load an option
storevalue from a cookie or default value if no prior stored value exists.
KNFunctionnulcontext check: Returnstrueif the length of thecontextis less than or equal toncharacters.
KOFunction- Outputs the specified string to an element, overwriting
ndcharacters before the caret.
KRFunction- Register the keyboard stub and load the keyboard.
KRSFunction- Register the keyboard stub, return true if already registered.
KSAVEFunction- Save an option
storevalue to a cookie for the active keyboard.
KSETSFunction- KSETS sets the value of a system
storeto a string.
KSFFunction- Save focus: Temporarily saves keyboard processing data for the currently-focused control.
KTFunction- Inserts a text string and optional
deadkeyinto the active output element.


