Hello Marika,
As per my understanding you want to continue with the execution of your code after you detect one or more key presses on the device after creating and starting the queue of events.
I would suggest you to use the ‘pause’ function for this purpose. This function temporarily stops execution and waits for the user to press any key. Introduce the ‘pause’ function without any arguments after starting your queue.
Alternatively, you can try using the ‘KbQueueWait’ function, in the ‘Psych Toolbox’ itself, that waits for a key to be pressed and returns the time of the press.
Refer to the following documentation to understand more about ‘pause’ function.
Hope this helps!