Adds keyboards to KeymanWeb.
keyboard name string or keyboard metadata JSON object
fulfilled upon adding keyboards.
The promise is an array containing a combination of the following:
- successfully registered keyboard objects which define some or all of these properties
- ErrorStub objects for keyboards that failed to register
The keyboard spec can be a string or an object. Multiple keyboard specs can be specified in a single call, which can reduce the round-trip cost of multiple calls to Keyman Cloud servers (when using Keyman Cloud).
For general information and example uses of this method, please see the Adding Keyboards page from the guide section.
When keyboard spec is a string, the Keyman Cloud is used to source the keyboard file. Keymanweb will load webfonts and keyboard file automatically on demand. The string format is one of the following:
'keyboardID': Adds a specific keyboard, linking it to the default language for the keyboard
'@languageID': Adds the default keyboard for the specified BCP 47 language code
'keyboardID@languageID': Loads a specific keyboard + language combination
The keyboard catalogue is online at http://keyman.com/developer/keymanweb/keyboards.
When keyboard spec is an object, then more parameters can be specified, including sourcing the keyboard from locations other than the Keyman Cloud. The specification of the object is related to the Keyman Cloud JSON API (formerly known as KeymanWeb Server Data API):
spec object contains the following members:
Name of the keyboard.
ID (internal name) of keyboard, together with version always matches the filename of the keyboard
url of keyboard *.js file, relative (to page) or absolute
An array of objects (see definition below) or single object linked to the keyboard.
trueif the keyboard targets a right-to-left script. May be set to
Version of keyboard *.js file
A name to display in the spacebar of the keyboard; if omitted, use the default
spec.languages object contains the following members:
Name of the language.
BCP 47 language code.
Required when using the Toolbar UI. May be set with one of the following region names:
An array of Font objects (see definition below) or single object describing fonts for input fields and the OSK (if
oskFontis not present.)
An array of Font objects (see
fontdefinition below) or single object describing fonts for the OSK.
spec.languages.font object contains the following members:
Font family that KeymanWeb will provide for this font.
Array of URLs where font resources can be accessed, relative to the
fontsinitialization property. Multiple font resources can be specified as platform font format support varies and KeymanWeb will pick the most appropriate for the platform.
Font size (in CSS dimensions). If not specified, then