Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Super simple browser based key event dispatcher library.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


Keypa is a super simple key event dispatcher that makes registering callbacks to keyevents easy.


Just include the keypa.js file in your page and create a new keypa instance. So you are able to register key events.

<script src="keypa.js"></script>

    var keypa = Keypa();

    keypa.on('esc', function(e) {
        // this function is called on pressing "escape"
        // "e" is the fired key event

Checkout the example file by pointing your browser to /examples/keypa_example.html.

It is possible to register blocking key events. So you can create key events, that blocks all other keys when they are active. The following code will unblock all blocked keys on the "enter" and "esc" key, that are blocked by key "f".

    keypa.blocks(['f'], ['enter', 'esc']);

    keypa.on('f', function(e) {
        console.log('#### key "f" was pressed and blocks now any other keys ####');
        console.log('#### press key "enter" or "esc" to unblock keys ####');


Tests are implemented with Just point your browser to /test/keypa_test.html.

Questions and suggestions?

Send me a message on github.

Something went wrong with that request. Please try again.