Output Functions - the Keyboard API
The KeymanWeb core object window.keyman.interface (with legacy-oriented, deprecated alias
KeymanWeb) 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.
anyFunction (Deprecated)- Returns whether or not the char
chis found within theany(store) string, setting an internally-tracked index for use in theindexOutputfunction. - Shorthand name:
KeymanWeb.KA
beepFunction- Flash body or element as substitute for an audible feedback
beep. - Shorthand name:
KeymanWeb.KB
beepResetFunction- Cancels a previous feedback
beepoperation on a page element. - Shorthand name:
KeymanWeb.KBR
contextFunction (Deprecated)- Gets
contextfor an ongoing keyboard operation relative to the caret's present position. - Shorthand name:
KeymanWeb.KC
contextMatchFunction (Deprecated)- Context matching: Returns
trueif the specifiedcontextcall matches a provided string. - Shorthand name:
KeymanWeb.KCM
deadkeyMatchFunction (Deprecated)- Deadkey matching: Seeks to match the
deadkeystatedkat the relative caret positionn. - Shorthand name:
KeymanWeb.KDM
deadkeyOutputFunction- Deadkey output: Associates the
deadkeystatedkwith the element at the current caret position, after overwritingndcharacters. - Shorthand name:
KeymanWeb.KDO
deleteContextFunction- Context deletion - removes the specified number of deadkeys and characters from the left of the caret.
- Shorthand name:
KeymanWeb.KDC
fullContextMatchFunction- Context matching: Returns
trueif the current context matches the specified rule context specification. - Shorthand name:
KeymanWeb.KFCM
ifStoreFunctionifStorecompares the content of a systemstorewith a string value.- Shorthand name:
KeymanWeb.KIFS
indexOutputFunction- Index-based output: Outputs a mapped character according to a previous selection from a
keyman.interface.any()call upon astorestring, after deletingndcharacters. - Shorthand name:
KeymanWeb.KIO
insertTextFunction- Inserts a text string and optional
deadkeyinto the active output element. - Shorthand name:
KeymanWeb.KT
isKeypressFunction- Returns
trueif the input event corresponds to a keypress event resulting in character output. - Shorthand name:
KeymanWeb.KIK
keyInformationFunction- Returns an object with extended information about a specified keystroke event.
- Shorthand name:
KeymanWeb.KKI
keyMatchFunction- Keystroke matching: Returns
trueif the event matches the rule's shift mask and key code. - Shorthand name:
KeymanWeb.KKM
loadStoreFunction- Load an option
storevalue from a cookie or default value if no prior stored value exists. - Shorthand name:
KeymanWeb.KLOAD
nulFunctionnulcontext check: Returnstrueif the length of thecontextis less than or equal toncharacters.- Shorthand name:
KeymanWeb.KN
outputFunction- Outputs the specified string to an element, overwriting characters before the caret if specified.
- Shorthand name:
KeymanWeb.KO
registerKeyboardFunction- Register the keyboard stub and load the keyboard.
- Shorthand name:
KeymanWeb.KR
registerStubFunction- Register the keyboard stub, return true if already registered.
- Shorthand name:
KeymanWeb.KRS
saveFocusFunction- Save focus: Temporarily saves keyboard processing data for the currently-focused control.
- Shorthand name:
KeymanWeb.KSF
saveStoreFunction- Save an option
storevalue to a cookie for the active keyboard. - Shorthand name:
KeymanWeb.KSAVE
setStoreFunctionsetStoresets the value of a systemstoreto a string.- Shorthand name:
KeymanWeb.KSETS
stateMatchFunction- State-key matching: Returns
trueif the event matches the rule's state-key requirements. - Shorthand name:
KeymanWeb.KSM


