If this template helps then use it. If not then just delete and start from scratch.
OS - Windows 7
PsychoPy version - 1.9:
What are you trying to achieve?:
I would like triggers to be sent whenever a participant response.
My allocated keys for responses are left and down
What did you try to make it work?:
I added a code component and at the Begin Experiment tab I added:
codeTable = {“down”:11, “left”:12} ,
Then I added an I/O and in the start data section i added codeTable[key_resp_2.keys], but it doesnt work.
I also tried codeTable[key_resp_2.keys[0]] but it did not work.
What specifically went wrong when you tried that?:
The error I received was the following:
win.calOnFlip(p_port_4.setData,int(codeTable[key_resp_2.keys]))
TypeError: unhashable type: ‘list’