keywatcher.js for Mootools

About

This is a demonstration of what can be done with the Mootools extension keywatcher.js.

You can navigate though the sections of this accordion using the up and down Arrow keys. The Document has links, that can be called by pressing [CTRL] and the number next to the link. In this demo it will only display the link in an alert box just to make a point.

Link shortcuts and Accordion navigation are not integrated into keywatcher.js. I only wrote those functions to show what can be done. If you want to know how those functions work look at the source code of this page.

Usage

Using keywatcher.js is as easy as cake. All you have to do is create a new keyWatcher object and add keys to watch. var nav = new Keywatcher( $E('html'), function(key,modifier) {} ).addKey("a", 0); This will create a new Keywatcher Object, that calls the function as soon as "a" is pressed with no modifier. var nav = new Keywatcher( $('inputf'), function(key,modifier) {} ).watchAllKeys(); This watches all keys and modifiers.

More

You can dowload it here

Here is a tool to see which keys have which codes. Be aware, that many codes differ, when a modifier is pressed. I will work around that in the next version.

Take a look at my blog if you like

Credits

keywatcher.js was written by Stefan Lange-Hegermann in 2006

© 2006 Stefan Lange-Hegermann