Hi Raul,
I could be wrong, but it seems from looking at the code within the Builder keyboard component that it can't (currently) work with variable names in the AllowedKeys field.
Raul- ignore the following bit in brackets, it is mainly directed to Jon, or someone else who understands Builder component conventions:
[In the lines from approximately 112 in keyboard.py it says:
try:
keyList = eval(self.params['allowedKeys'].val)
except:
raise CodeGenerationException(self.params["name"], "Allowed keys list is invalid.")
So if a variable name was used in the allowedKeys field, Builder would be trying to evaluate it at compile time, although it won't actually be defined until runtime?]
Raul- just to check explicitly: do you want to have lists of allowed keys that vary from trial to trial, and hence you are trying to have them specified as a variable from a conditions .xlsx file?
Regards,
Michael
On 4 Jan, 2013, at 08:43, Raul Gonçalves <
rag...@gmail.com> wrote:
> Hi Everyone,
>
> I'm having a puzzling issue here. I'm running the latest update 1.75.01 on windows on the builder, and I know nothing of python whatsoever. I am trying to use variables in the allowed keys too... I've tried a few combinations of configuration between the xlsx file and the allowed keys field, including inserting the key names between apostrophes in the xlsx, etc. I get the "Allowed keys list is invalid" for all configurations I tried, except one: in the xlsx file, I wrote the names of the keys that should be allowed, and in the builder field, i wrote the variable name between apostrophes ( like this: '$corrTecla' ). It compiles without error, but the keyboard becomes useless (none of the keys i tried, except for 'esc', work).
>
> What I want to do is keep record of all keys pressed by the subject during each trial, and only end the trial when he/she presses the correct one. If there is another way of doing it, I'd appreciate.
>
> By the way, let me take the opportunity to thank Jon, the other developers and all the Psychopy community for this amazing tool. I've been promoting it to all my colleagues here in Brazil - we just need more psychologists that can code down here :D !!!