New Userscript

custom keymap overlay for monkeytype

נכון ליום 21-06-2021. ראה הגרסה האחרונה.

  1. // ==UserScript==
  2. // @name New Userscript
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description custom keymap overlay for monkeytype
  6. // @author Joe. Joe Mama.
  7. // @match https://monkeytype.com/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. function swap(key1, key2){
  15. var k1 = document.getElementById("Key"+key1);
  16. var k2 = document.getElementById("Key"+key2);
  17. k1.id = "Key"+key2;
  18. k2.id = "Key"+key1;
  19. var tempk1val = k1.getElementsByTagName("span")[0].innerText
  20. k1.getElementsByTagName("span")[0].innerText = k2.getElementsByTagName("span")[0].innerText
  21. k2.getElementsByTagName("span")[0].innerText = tempk1val
  22. }
  23.  
  24.  
  25. //just right click anywhere for the changes to be made
  26. //the goal is to have keys swap places with each other on the keymap to suit your layout
  27. window.oncontextmenu = function (){
  28. //use capital letters for keys, swap("a","b"); will not work, you will have to use swap("A","B");
  29. //for symbols like ";" type them like "Semicolon", if you have doubts on the word then just inspect element the key and see what the 'id' of the element is
  30. swap("O","Semicolon");
  31. swap("F","G");
  32. swap("Z","Quote");
  33. swap("K","Quote");
  34. swap("D","Quote");
  35. swap("C","Quote");
  36. swap("X","Quote");
  37. };
  38. })();