Skip to content

Instantly share code, notes, and snippets.

@mbostock
Created August 7, 2012 18:21
Show Gist options
  • Save mbostock/3288044 to your computer and use it in GitHub Desktop.
Save mbostock/3288044 to your computer and use it in GitHub Desktop.
Google Hurdles
function key(type, code) {
var e = document.createEvent("Event");
e.initEvent(type, true, true);
e.keyCode = code;
document.getElementById("hplogo").dispatchEvent(e);
}
setInterval(function() {
key("keydown", 37);
key("keypress", 37);
key("keyup", 37);
key("keydown", 39);
key("keypress", 39);
key("keyup", 39);
}, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment