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
// ==UserScript== | |
// @name Kahoot hotkeys | |
// @namespace mvolfik.github.io | |
// @version 0.2 | |
// @description take over the world! | |
// @author mvolfik | |
// @match https://kahoot.it/v2/* | |
// ==/UserScript== | |
(function() { | |
document.onkeypress=function(e){ | |
console.log(e.keyCode); | |
switch (e.keyCode) { | |
case 52: | |
document.querySelectorAll("button[data-functional-selector~=answer-0]")[0].click(); | |
break; | |
case 53: | |
document.querySelectorAll("button[data-functional-selector~=answer-1]")[0].click(); | |
break; | |
case 49: | |
document.querySelectorAll("button[data-functional-selector~=answer-2]")[0].click(); | |
break; | |
case 50: | |
document.querySelectorAll("button[data-functional-selector~=answer-3]")[0].click(); | |
break; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment