Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Do something when a series of keystrokes is entered in a webpage
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
GPL-LICENSE.txt
MIT-LICENSE.txt
README.markdown
demo.html
jquery.keysequencedetector.js

README.markdown

jQuery Key Sequence Detector Plugin

What?

This plugin watches for a sequence of characters to be typed, and executes some function when detected.

Checkout demo.html for an example.

How?

Suppose you have this script:

$(window).keySequenceDetector('boom', function(){ alert('goes the dynamite'); });

The plugin will pop up an alert box whenever the user types in the four consecutive letters b-o-o-m.

Note!

This plugin allows you to keep on chaining, so, for example:

$('#myelement').keySequenceDetector().css({border:'1px solid blue'});

Would run keySequenceDetector on #myelement then add a blue border to it after.

Options:

The following options can be provided like so (default values specified):

$('.yourSelector').keySequenceDetector({

     wildcard: '.'

});      

Whats next?

The world!

Found a bug?

Submit a bug report above or here

Or ping me on Twitter or on my blog

Something went wrong with that request. Please try again.