KaBoot(modified)

Allows you to press the 1234 keys on your keyboard to trigger the Kahoot answer buttons

当前为 2021-04-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name KaBoot(modified)
  3. // @namespace https://tampermonkey.net
  4. // @version 0.1
  5. // @description Allows you to press the 1234 keys on your keyboard to trigger the Kahoot answer buttons
  6. // @author lifavo
  7. // @match https://kahoot.it/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. document.addEventListener('keydown', e => {
  13. if (event.isComposing ||e.keyCode == 49) {
  14. document.querySelector('[data-functional-selector="answer-0"]').click();
  15. }
  16. if (event.isComposing ||e.keyCode == 50) {
  17. document.querySelector('[data-functional-selector="answer-1"]').click();
  18. }
  19. if (event.isComposing ||e.keyCode == 51) {
  20. document.querySelector('[data-functional-selector="answer-2"]').click();
  21. }
  22. if (event.isComposing ||e.keyCode == 52) {
  23. document.querySelector('[data-functional-selector="answer-3"]').click();
  24. }
  25. });
  26. })();