Skip to content

Instantly share code, notes, and snippets.

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