Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (window.addEventListener) {
- keys = [], code = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];
- window.addEventListener("keyup", function(e) {
- keys.push(e.keyCode);
- if (keys.length > code.length) {
- keys.shift();
- }
- if (keys.length == code.length) {
- if (keys.toString() == code.toString()) {
- console.log("you did it!");
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement