Skip to content

Instantly share code, notes, and snippets.

@mbostock mbostock/index.js
Created Aug 7, 2012

Embed
What would you like to do?
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
You can’t perform that action at this time.