Skip to content

Instantly share code, notes, and snippets.

@misson20000
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save misson20000/8a20b8f9dff3e2018440 to your computer and use it in GitHub Desktop.
Save misson20000/8a20b8f9dff3e2018440 to your computer and use it in GitHub Desktop.
Ludum Dare Theme Slaughter Key Shortcuts
// ==UserScript==
// @name Ludum Dare Theme Slaughter Keyshortcuts
// @namespace xenotoad.net
// @include http://ludumdare.com/theme/*
// @version 1
// @grant none
// ==/UserScript==
// A: Good
// S: Slaughter
// D: Bad
document.addEventListener("keyup", function(evt) {
var s = String.fromCharCode(evt.keyCode);
var a = document.getElementsByTagName("a");
console.log(s);
if(s == "A") {
window.location = a[1].href;
} else if(s == "S") {
window.location = a[3].href;
} else if(s == "D") {
window.location = a[2].href;
}
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment