Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

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

On this page

Events - Keyman Engine for Web


A number of 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.

Two components of Keyman Engine for Web specify events:

  • keyman object -- the main component
  • keyman.osk object -- the on-screen keyboard component

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


keyman events

beforekeyboardchange
Called when keyboard input language about to change.
controlblurred
Called when input element loses focus.
controlfocused
Called when input element receives focus.
keyboardchange
Called when keyboard input language changed.
keyboardloaded
Called when keyboard code loaded.
keyboardregistered
Called when keyboard 'stub' processed (for listing as available keyboard).
loaduserinterface
Called when allow ui initialization.
unloaduserinterface
Called when allow ui clean-up.

For example, to define a user function to handle the KeymanWeb keyboardchange event, include:

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

keyman.osk On Screen Keyboard events

configclick
Called when allows the UI to present KeymanWeb configuration options.
helpclick
Called when allows the UI to present a help page.
hide
Called when OSK hidden.
resizemove
Called when OSK resized or moved on desktop.
show
Called when OSK displayed.

For example, to add an event handler that modifies the user interface when the on-screen keyboard is displayed:

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