Advertisement
Mangus875

Javascript Steno Keyboard

Oct 23rd, 2023
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const stenotype = "STKPWHRAO*EUFRPBLGTSDZ";
  2. const stenoMap = "SSTKPWHRAO****EUFRPBLGTSDZ";
  3. const keyboard = "QAWSEDRFCVTYGHNMUJIKOLP;['";
  4.  
  5. var keysDown = [];
  6.  
  7. window.onkeydown = function(e) {console.log(e.code)}
  8.  
  9.  
  10. function findIn(val, arr) {
  11.     let index = 0;
  12.     let found = arr.find(function (curVal) {
  13.         index++;
  14.         return curVal == val;
  15.     });
  16.  
  17.     if (found) {
  18.         return index - 1;
  19.     }
  20. }
  21.  
  22. function isIn(val, arr) {
  23.     return arr.find(function (curVal) {
  24.         return curVal == val;
  25.     }) != undefined;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement