Need help with PS4 Keyboard.write input

so i'm a bit lost here guys, maybe someone can help me out with this....

i want to include a function into my existing sketch, which looks like this:

  if (key){
     holdKey = key;
     Serial.println(key);
   }

   if (kpd.getState() == HOLD) {
      if ((millis() - t_hold) > 30 ) {
          switch (holdKey) {
              case 'j':
                  Keyboard.press('j');
                  delay(10);
                  Keyboard.release('j');
                  break;
          }
          t_hold = millis();
      }
   }

now what i want to do is add another button in there with the following function:

should switch the key "3" on and off for 6 times (3 times each). since the Playstation 4 doesn't recognize keyboard.press and a let's say a delay of 1000 and then keyboard.release , it needs to be keyboard.write"..."

i have read so many tutorials, but still can't figure out how the tell the arduino to press 6 times a button not more not less, without the delay function.

i have read so many tutorials, but still can't figure out how the tell the arduino to press 6 times a button not more not less, without the delay function.

set a counter to zero. declare it static write the value save the time of the write go round loop() until millis() minus the write time equals or is greater than 1000 increment the counter if the counter has reached 6 move on to other code else keep going round loop() writing when the timing period passes, saving the time, incrementing the counter

sounds simple, yet so difficult :D :D will there be a "delay" with this type of code? say is it possible to push other buttons during this function?

is it possible to push other buttons during this function?

Yes. That is the point of the technique being non blocking and allowing loop() to run freely so that you can do other things during the "delay" such as reading inputs.