| Reference | Downloads | Github

Keyboard keys initialized with 'undefined' type - not liked by browser

I am getting an undefined keyboard keys error (both for keySendResponse.keys and keyMoveCursor.keys) while running my project test2.js on Pavlovia.

The link to my project is
The keyboards themselves are defined in lines 188 and 190.
Then in the function recallRoutineBegin, keySendResponse.keys and keyMoveCursor.keys are initialized with ‘undefined’ type (lines 756 and 759).
Each frame, I use the keyMoveCursor keys to move an image stimulus on the screen (recallRoutineEachFrame function). The main condition I use is the length of the key list. So when I am checking the length for the first frame - the keys are of undefined type (line 867) and an exception is thrown.
As a workaround, I tried to replace undefined with an empty list (and the corresponding emptiness conditions in the recallRoutineEnd function) - but it seems to change the behaviour.

Could you please advice me how can I fix this issue?

Thank you in advance!