I want to end a trial once a particular key has been held down for 2 seconds.
I have code block in the trial loop and at
Begin Routine I reset the clock and key list.
kb.clock.reset() kb.getKeys(clear = True)
Each Frame I do this.
keys=kb.getKeys(['up'], waitRelease=False) for thisKey in keys: if thisKey.name=='up': print(thisKey.tDown) print(kb.clock.getTime()) if kb.clock.getTime() - thisKey.tDown >2: continueRoutine=False
But it doesn’t work because
thisKey.tDown is off a different base time to kb.clock:
884656.2689883 #thisKey.tDown 2.2038408999796957 #kb.clock.getTime()
Anyone know what clock is
thisKey.tDown is running off here?
Or a better way to get the functionality i want?