Variables in allowedKeys

Description of the problem:
I want to set conditional keypresses for my trials in a loop. In the allowedKeys, I input Keys, which is a column in my condition excel file that contains allowed key presses. For some trials, I want only [‘1’,‘2’,‘3’,‘4’,‘5’,‘6’] to be allowed whereas for others only [‘t’] to be allowed.

I can successfully run the file locally and it seems to work perfectly. However, I noticed the JS file in my folder is not updated whenever I make a change. When running the study online (JS for local debug or on Pavlovia), it does not seem to choose the corresponding keypresses that I specify in my excel file.

Thank you in advance!

Hi

I don’t think variable allowed keys has been implemented online yet, though it can be done fairly simply in a code component. Something like:

keys=event.getKeys()

if len(keys):
     if keys[0] in allowedKeys:
          stuff
          continueRoutine=False

Best wishes,

Wakefield