Mismatch reaction times Mac and Windows ? (Negative RT)

Hi you all,

Here is something I do not understand:
I have an experiment coded and tested with a Mac laptop on Psychopy 2021.2.3
It records all the reaction time as wanted and if I respond too late or too early, it saved them as Nan (which is what I want)

However, when I ran the same code with a windows computer it stores some rt as negative. Do you know where this is coming from ??

If that helps relevant part of my script below:


Response.getKeys(clear = True)
if Response.status == NOT_STARTED and tThisFlip > 1-frameTolerance:
# keep track of start time/frame for later
Response.frameNStart = frameN # exact frame index
Response.tStart = t # local t and not account for scr refresh
Response.tStartRefresh = tThisFlipGlobal # on global time
win.timeOnFlip(Response, ‘tStartRefresh’) # time at next scr refresh
Response.status = STARTED
# keyboard checking is just starting
waitOnFlip = True
win.callOnFlip(Response.clock.reset) # t=0 on next screen flip
if Response.status == STARTED:
# is it time to stop? (based on global clock, using actual start)
if tThisFlipGlobal > Response.tStartRefresh + current_jitter -frameTolerance:
# keep track of stop time/frame for later
Response.tStop = t # not accounting for scr refresh
Response.frameNStop = frameN # exact frame index
win.timeOnFlip(Response, ‘tStopRefresh’) # time at next scr refresh
Response.status = FINISHED
if Response.status == STARTED and not waitOnFlip:
theseKeys = Response.getKeys(keyList=[‘1’, ‘3’], waitRelease=False)
if len(_Response_allKeys):
Response.keys = _Response_allKeys[0].name # just the first key pressed
Response.rt = _Response_allKeys[0].rt

            # was this correct?
            if (Response.keys == str(corrAns)) or (Response.keys == corrAns):
                Response.corr = 1
                Response.corr = 0

Do you define corrAns inside the key, as shown below:

Yes, initially That’s what we have.
But we are not using the builder now only the coder

That being said we have no problem with accuracy , only this negative RT time to time [with windows computer and psychopy 2020.2.10 ] while I never have negative with my Mac and psychopy 2021.2.3

So I’m confused and I don’t know how to fix it given that even cleaning the buffer does not solve it

maybe it needed that

win.callOnFlip(Response.clearEvents, eventType=‘keyboard’)

instead of

Response.getKeys(clear = True)

will test it and let you know

oh yes that worked !

so the clear event needed to be on the win flip… now we know :slight_smile: