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