My current experiment looks like this. Position of each image is asked after displaying them briefly. I want to stop participants from pressing one arrow key multiple times in a trial. So, when the first image is shown and the participant presses up, they should no longer be able to press up for the remaining 3 images and so on for the other keys also until they are left with just one key for the 4th keypress.
How do I ensure that in Psychopy? Any help will be appreciated.
To confirm. Are you asking for the participant to press four different arrow keys for a single routine?
Do you just need to know the order of the presses. If so, how about:
Begin Routine
keysPressed = []
rts = []
oldKey = None
Each Frame
if key_resp.keys != oldKey:
oldKey = key_resp.keys
if oldKey not in keysPressed:
keysPressed.append(oldKey)
rts.append(key_resp.rt)
if len(keysPressed) == 4:
continueRoutine = False
No, I have 4 separate routines for the 4 responses. In each routine all the keys are allowed but only one press per routine can be made. However, I want that once one key is pressed in one routine, it should be removed from the option to be pressed again in the next routine and so on. Hope this makes it a little clear.
Based on the responses, how can i make the boxes appear crossed out, so every time a key is pressed the box associated with that key should be replaced by a box with cross and so on.
Can you help me with the code? So suppose 1st response is up then up box should be crossed out and it should stay then 2nd response is down so now both up and down should appear crossed and so on