Created
August 7, 2012 13:50
-
-
Save amatiasq/3285490 to your computer and use it in GitHub Desktop.
Hack today's Google's Doodle (press numpad 0 to start)
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 press(key) { | |
document.getElementById("hplogo").onkeydown({ | |
keyCode:key, | |
preventDefault:function() { } | |
}); | |
} | |
var interval; | |
document.addEventListener('keydown', function(e) { | |
if (e.keyCode !== 96) | |
return; | |
if (interval) { | |
clearInterval(interval); | |
interval = null; | |
} else { | |
interval = setInterval(function() { | |
press(37); | |
press(39); | |
}, 0); | |
} | |
}, true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment