mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-06 00:45:32 +00:00
Note: build.sh updated to make sure that test:help build action:target doesn't also call test.sh by adding `:_all` meta-target. Note: CI will need a new help-keyman-com.sh build step to deploy web engine help. Fixes: #12347
65 lines
1.9 KiB
Markdown
65 lines
1.9 KiB
Markdown
---
|
|
title: Utility Module
|
|
---
|
|
|
|
The KeymanWeb Utility Function module is exposed to the developer as `window.keyman.util`.
|
|
|
|
[`addStyleSheet` Function](addStyleSheet)
|
|
: Add or override default On-Screen Keyboard styles.
|
|
|
|
[`alert` Function](alert)
|
|
: Customized alert window.
|
|
|
|
[`attachDOMEvent` Function](attachDOMEvent)
|
|
: Attach user-defined event handler for any DOM event for an element.
|
|
|
|
[`createElement` Function](createElement)
|
|
: Create an unselectable HTML element for the KeymanWeb On-Screen
|
|
keyboard and User Interfaces.
|
|
|
|
[`detachDOMEvent` Function](detachDOMEvent)
|
|
: Detach DOM event handler from element to prevent memory leaks.
|
|
|
|
[`getAbsolute` Function](getAbsolute)
|
|
: Get the absolute position of an element.
|
|
|
|
[`getAbsoluteX` Function](getAbsoluteX)
|
|
: Get the absolute y-coordinate of an element.
|
|
|
|
[`getAbsoluteY` Function](getAbsoluteY)
|
|
: Get the absolute y-coordinate of an element.
|
|
|
|
[`getOption` Function](getOption)
|
|
: Get a KeymanWeb, On-Screen Keyboard or User Interface option value.
|
|
|
|
[`isTouchDevice` Function](isTouchDevice)
|
|
: Allow external callers (such as UIs) to detect if the active device
|
|
is touch sensitive.
|
|
|
|
[`linkStyleSheet` Function](linkStyleSheet)
|
|
: Add a reference to an external stylesheet file.
|
|
|
|
[`loadCookie` Function](loadCookie)
|
|
: Get a document cookie, or an array of all document cookies.
|
|
|
|
[`removeStyleSheet` Function](removeStyleSheet)
|
|
: Remove user-defined style sheet.
|
|
|
|
[`rgba` Function](rgba)
|
|
: Browser-independent alpha-channel management.
|
|
|
|
[`saveCookie` Function](saveCookie)
|
|
: Save document variables as a cookie.
|
|
|
|
[`setOption` Function](setOption)
|
|
: Set a KeymanWeb, On-Screen Keyboard or User Interface option value.
|
|
|
|
[`toFloat` Function](toFloat)
|
|
: Floating conversion with default.
|
|
|
|
[`toNumber` Function](toNumber)
|
|
: Integer conversion with default.
|
|
|
|
[`toNzString` Function](toNzString)
|
|
: Returns default string value if argument is null, false, an empty
|
|
string, or undefined.
|