","").replace("-"," ").replace(/\b\w/g,e=>e.toUpperCase()).replace(/\s+/g," ").trim(),e=void 0,results_set=!1,c=0,v(text)},l=document,b=l.getElementById.bind(l),u=l.addEventListener.bind(l),k=e=>e.innerHTML,p=(e,t)=>{e.innerHTML=t},v=e=>{p(a,""),p(r,e.charAt(0)),p(n,e.substring(1)),t=e.split(" ").length};u("DOMContentLoaded",function(e){a=b("tm"),r=b("tr"),n=b("tu"),b("cl").addEventListener("click",function(e){switch(k(e.target)){case"QWERTY":o="aoeuiqjkxyp",p(e.target,"Dvorak");break;case"Dvorak":o="qazwrxfscptvgdb",p(e.target,"Colemak");break;default:o="qazwsxedcrfvtgb",p(e.target,"QWERTY")}}),d()}),u("keyup",function(e){e.location===KeyboardEvent.DOM_KEY_LOCATION_LEFT?i=!1:e.location===KeyboardEvent.DOM_KEY_LOCATION_RIGHT&&(s=!1)}),u("keydown",function(l){var u="";switch(l.keyCode){case K.C:l.preventDefault(),u=" ";break;case K.F:l.preventDefault(),u="/";break;case K.M:u=",";break;case K.P:u=".";break;case 173:u="-";break;case K.S:if(l.location===KeyboardEvent.DOM_KEY_LOCATION_LEFT)return void(i=!0);if(l.location===KeyboardEvent.DOM_KEY_LOCATION_RIGHT)return void(s=!0);case K.B:p(n,k(r)+k(n)),p(r,k(a).slice(-1)),p(a,k(a).slice(0,-1));break;default:K.KEY_0<=l.keyCode&&l.keyCode<=K.Z&&(u=String.fromCharCode(l.keyCode).toLowerCase(),s&&i?u="":s?u=o.includes(u)?u.toUpperCase():"":i&&(u=o.includes(u)?"":u.toUpperCase()))}if(u==k(r)?(e||(e=(new Date).getTime()),p(a,k(a)+u),p(r,k(n).charAt(0)),p(n,k(n).substr(1))):c++,0==k(n).length&&0==k(r).length){var v=(new Date).getTime(),g=b("te");p(g,`WPM:${(t/((v-e)/1e3/60)).toFixed(2)};Words:${t}; Mistakes:${c}`),d()}})}();
This keyboard tutor teaches you to use both the left and the right shift keys. Left hand letters can only be capitalized with the right shift and vice versa. Check out the source code on Github.