           {
             modMethod(PressTimer)[i]--;
           }
-          else
+          else if (modMethod(PressTimer)[i] == 0)
           {
+            modMethod(PressTimer)[i] = -1; // signal that the key has fired
             PressKey(modMethod(GetKeyVal)(i, modMethod(PressCount)[i] - 1), modMethod(GetKeyType)(i, modMethod(PressCount)[i] - 1));
-            if (modMethod(KeyIsDown)[i])
-            {
-              // do nothing
-            }
-            else
+            if (!modMethod(KeyIsDown)[i])
             {
               modMethod(KeyUp)(i, 19);
             }

      // sends the macro sequence with id = val
      ReleaseKey(modMethod(GetKeyVal)(val, modMethod(PressCount)[val] - 1), modMethod(GetKeyType)(val, modMethod(PressCount)[val] - 1));

      if (modMethod(KeyIsDown)[val])
      {
        // do nothing
      }
      else
      {

        modMethod(PressCount)[val] = 0;
        modMethod(PressTimer)[val] = 0;
      }

  }
  else if (input.startsWith("uniqueksettapdance"))
  {
    input = input.substring(input.indexOf('(')+1);
    byte id = input.substring(0, input.indexOf('(')).toInt();
    input = input.substring(input.indexOf('(')+1);
