I have this small snippet of code:
timeSinceStart = core.MonotonicClock() event.clearEvents('keyboard') core.wait(TIMING_INFO['response_time']) displayFixation() kbInputs = event.getKeys(timeStamped = timeSinceStart)
While a response screen and fixation are displayed, the system is recording all keys pressed. These key presses should all be timestamped with a MonotonicClock object however their outputted timestamps are incorrect. All key presses were recorded successfully, however it appears that calling core.wait() also prevents getKeys() from getting the correct timestamp. The output looks something like this:
(‘a’,2.997), ('b, ‘2.998’), (‘c’, 17.899), (‘d’, 17.999)
It’s important to note that two core.wait() functions are called during this key logging, one for 3 seconds and the other after it for 15 seconds. To me, it appears regardless of when the key is pressed, it’s timestamp is associated at the end of a core.wait() almost as if the two can’t be done at the same time. I was wondering if anyone had a good work around for this, or better method for collecting keyboard input in this manner?