Custom Layout keymap overlay for monkeytype.com

custom keymap overlay for monkeytype

Mint 2021.06.21.. Lásd a legutóbbi verzió

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

  1. // ==UserScript==
  2. // @name Custom Layout keymap overlay for monkeytype.com
  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. })();