![]() ![]() Pass # you can do something explicitly on missing response here. For instance, executing py -3.6 -m pip install psychopy from the command prompt will install PsychoPy and all its dependencies for Python 3.6 on Windows. # React to response (no win-flip here, I assume that you only need this change on next trial, where the above win.flip() will execute PsychoPy can be installed as a Python module with pip. Keys = event.getKeys() # you probably want to restrict which keys are valid? Otherwise you have to react to invalid keys later - which is also ok. # Register responses after approximately 1 second (time by frames if you want exact timing) and have an extra "return" Here's a revised code, which might be closer to what you want: # Create stimulus. No need to loop through keys when you're looking for particular values.In particular, you're instantiating a full stimulus several times on each trial when you really should just draw it (much faster and cleaner). You will see that instantiation and drawing should be done differently and much simpler. Look at the demos in coder -> demos -> stimuli to see how to present ShapeStims (Line, Rect, Circle etc.This guarantees that there's always exactly one key in the list returned. I do suspect that you really want to use event.waitKeys() which waits for the first keyboard event and returns that. In your case, the subject probably had around 0.1 seconds to press before it reached the event.getKeys() line because there's nothing time-padding between, like a core.wait or multiple win.flip()'s. It returns None if no keyboard events were registered in this frame. What is PsychoPy, how do you show stimuli, and how do you get input from subjectsIf you need of help with PsychoPy, I am available for consulting and progra. () returns a list of keys since the event module was instantiated OR since last getKeys() call OR since event.clearEvents(). ![]() Line2.makeLine(line2length)#calls the makeLine function of the line class Line2=line()#makes line2 an instance of line class ![]() Line2length=2#original length of the line Pos= ,interpolate=True,opacity=1.0,units='cm',size=length) Line = visual.Line(win=win,ori=-45,lineRGB=,lineWidth=3.0, fillRGB=None, I am not sure why, but it always shows an empty list of keys. I am using event.getKeys(), however, it is not recording the keys that are pressed. I am trying to have the user be able to adjust the length of a line displayed in psychopy by either pressing the up or down keys. ![]()
0 Comments
Leave a Reply. |