![]() ![]()
Thanks for the info Sol, that's really useful. # they pressed a key, but is what not a valid response, how should this be handled? RT= ktime-ftime # correct key was pressed, calc RT. If keys is None: # timeout, loop and let next stim appear. # !! note, you should get the current time right now so you can time stamp the key press, if any' !! Keys = waitKeys(2.0) # halts your program for up to 2 seconds, or until a key is pressed. # is displayed on, so usually, this is when you would take the # so right now, we are at the start of the retrace that your stim # tell video card to display your still on next retrace PatchStim ( win, tex = None, mask = 'gauss', sf = 0, size = 0.02*i, name = 'fixation', autoLog = False )) Will be relative to the Clock‘s last reset If True will return a list of tuples instead of a list of keynames.Įach tuple has (keyname, time). NB, pygame doesn’t return timestamps (they are KeyList is None all keys will be checked and the key buffer will beĬleared completely. Only keypressesįrom this set of keys will be removed from the keyboard buffer. Returns a list of keys that were pressed.Īllows the user to specify a set of keys to check for. PSYCHOPY DRAWING A STIMULUS BASED ON IF STATEMENT CODEI will post some demo code later if IĬan get it to work (unless someone already has a working demo?) It seems that should give more precise timing than the stroop demo or That in 2009 Dave Britton added timeStamps to the keypresses. Looks like we overlooked another good way of doing it. > record both a response (which key was pressed) and response time (in > I suggest you check out the stroop demo. > 30ms lag on the keyboard and the 16.6ms interval between screen refreshes). PSYCHOPY DRAWING A STIMULUS BASED ON IF STATEMENT FULL> Bear in mind the full set of timing issues of your computer (like the > I guess the question is, "How much do you need ms precision?" > from Builder currently requires a code component. > constantly polling the keyboard until it finds a keypress. > displays is to use event.waitKeys() which goes into a tight loop > Actually, the most precise approach, which can be used for static > frame limits the resolution of the timestamp to the frame rate (ie to > during presentation of a dynamic stimulus. > the most general approach, and the only way to handle checking keys Checking the keys once per frame using getKeys(), as Alex suggests, is ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |