Created
April 30, 2013 09:28
-
-
Save kaneel/5487629 to your computer and use it in GitHub Desktop.
konamimyass :) Replace sicritW with whatever encoded as character numbers you want
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function(root, $, ns) { | |
var w = root.window, | |
d = root.document, | |
MBX = !!w[ns] ? w[ns] : w[ns] = {}, | |
sicritW = "", // here you put your character table _ already encoded as numbers _ | |
letters = [], | |
timerINYOFACE = null, | |
jDoc = $(d); | |
jDoc.on("keyup", function(e) { | |
letters.push(e.keyCode); | |
if (letters.join("").substr(-1*(sicritW.length)) == sicritW) { | |
// do something | |
} | |
w.clearTimeout(timerINYOFACE); | |
timerINYOFACE = w.setTimeout(function() { | |
letters.length = 0; | |
}, 1000); | |
}); | |
}(this, jQuery, "MBX")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment