kbDom


Keywords
typewriter, dom, keyboard, traversal
License
MIT
Install
bower install kbDom

Documentation

typewriter Build Status

Summary

typewriter, is a client-side javascript library enables to wireup keyboard eventing to DOM elements.

===

Features

  • Simplicity
  • To implement the features required to bubble up for Keyboard events.
  • Reduces the boiler plate coding for handling the keyboard eventing with keycodes
  • Simple api
  • Exposes KeyMap definition to provide key mapping set

==

Installation

===

Sample Usage

The following example handles a esc key on a Text element with Id Text.
   var $el = document.getElementById('Text') ;
    typewriter.on({keyMap : keyboard.keyMapDefs.Esc, state: 'up'},$el,function(kbEvent){
          alert('Escaped');
    });
The following example handles a Down Arrow key on a Text element with Id Text.
    var $el = document.getElementById('Text') ;
    typewriter.on({keyMap : keyboard.keyMapDefs.Down, state: 'up'},$el,function(kbEvent){
          alert('Down Arrow Pressed');
    });