Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 17.0 (current version)Version 16.0Version 15.0Version 14.0Version 13.0Version 12.0Version 11.0Version 10.0Version 2.0

On this page

Events

A number of KeymanWeb events are exposed to allow the designer of a user interface to control the appearance and behavior of user interface elements. Standard event-processing requires all arguments to be passed as an array (object) with named member variables.

kmw.controlfocused
Called when input element receives focus.
kmw.controlblurred
Called when input element loses focus.
kmw.keyboardregistered
Called when keyboard 'stub' processed (for listing as available keyboard).
kmw.keyboardloaded
Called when keyboard code loaded.
kmw.beforekeyboardchange
Called when keyboard input language about to change.
kmw.keyboardchange
Called when keyboard input language changed.
kmw.loaduserinterface
Called when allow ui initialization.
kmw.unloaduserinterface
Called when allow ui clean-up.
osk.show
Called when OSK displayed.
osk.hide
Called when OSK hidden.
osk.resizemove
Called when OSK resized or moved on desktop.
osk.helpclick
Called when allows the UI to present a help page.
osk.configclick
Called when allows the UI to present KeymanWeb configuration options.

Object events are handled in user code by passing the handler entry to the object, using addEventListener().

So to define a user function to handle the KeymanWeb core kmw.keyboardchange event, include:

keymanweb.addEventListener('keyboardchange',
  function(p)
  {
    ui.updateMenu(p['internalName'],p['languageCode']);
  });
  

or a user function to modify the user interface when the on-screen keyboard is displayed:

osk.addEventListener('show',
  function(p)
  {
    ui.updateUI(p['x'],p['y'],p['userLocated']);
  });