Is there an open source JS library for keyboard bindings in a browser?

I am looking to create a JavaScript application that is heavily dependent on keyboard shortcuts, is there an open source library here that meets these requirements with cross-browser support and plain Api?

+3
source share
3 answers

Keymaster

A simple micro-library for identifying and dispatching keyboard shortcuts. It has no dependencies.

// define short of 'a'
key('a', function(){ alert('you pressed a!') });

// returning false stops the event and prevents default browser events
key('ctrl+r', function(){ alert('stopped reload!'); return false });

// multiple shortcuts that do the same thing
key('⌘+r, ctrl+r', function(){ });
+4
source

I recently wrote a library called mousetrap. Check it out at http://craig.is/killing/mice .

keymaster, , , , , ..

.

+4

Take a look at jquery.hotkeys and KeyboardJS .

+1
source

All Articles