Skip to content

Instantly share code, notes, and snippets.

@toshinarin
Last active August 29, 2015 14:02
Show Gist options
  • Save toshinarin/4b209aefd2183d5f192e to your computer and use it in GitHub Desktop.
Save toshinarin/4b209aefd2183d5f192e to your computer and use it in GitHub Desktop.
(function(fire) {
var cmd = [38,38,40,40,37,39,37,39,66,65], l = cmd.length, pos = 0;
$(document).on('keydown', function(event) {
var key = event.which;
if (cmd[pos] !== key) {
pos = 0;
} else if (++pos === l) {
fire();
pos = 0;
}
});
})(function(){
alert('コナミ!');
});
@toshinarin
Copy link
Author

http://qiita.com/sonodar/items/b1da050e4cc2806bba9d に触発されて作ってみました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment