keyboard presses before their time
Hi,
I would like to know how to ignore keyboard presses that happened before the keyboard input of the sketchpat (I think that this is what "Flush key pending events" does for the keyboard_response item)
I have a sketchpad A that lasts 2 minutes and then another sketchpad B with duration sets to "keypress". I noticed that if you press something during the sketchpad A, after the two minutes the sketchpad B gets skipped. How can I make that sketchpad B ignores the keyboard presses of sketchpad B?
Thanks,
Bruno

Comments
Hi Bruno,
The easiest way is probably to set the duration of the
sketchpadto 0, and then use akeyboard_responseto wait for the keypress.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks for the fast answer, but it's still not working. I'm attaching a minimal example, if you press anything during the "wait" sketchpad, then the "press" sketchpad gets skipped.
Bests,
Bruno
Right, I see. You can add a
keyboard_responsewith a 0 ms timeout between the twosketchpads. That will flush pending key presses but not actually wait for a key press.Check out SigmundAI.eu for our OpenSesame AI assistant!
Do you mean like this? It's still not working correctly.
HI Bruno,
Yes exactly. Are you running on Linux (or perhaps Mac OS)? For some reason flushing doesn't work there, but I'm not sure why. On Windows it will.
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hey guys,
It is reminding me a little bit the issue I had there but with mouse response:
http://forum.cogsci.nl/index.php?p=/discussion/4028/reseting-mouse-position-between-mouse-responses#latest
Another way to fix it would be to create a ghost keyboard response between sketchpad.
Just tried it on OSX and it works apparently (see the file).
Best,
Sylvain
Hi,
I'm using Linux (and also the experiment is running in Linux). Sylvain's workaround didn't work either. Any other ideas?
sorry to bother with this, but what can I do besides putting a "don't press anything" in the waiting sketchpad?
Hi Bruno,
It took me a while to figure this out, but it's fixed in the latest prerelease of 3.2.5 (now 3.2.5.a6). You can update through
pipor, if you're running Ubuntu, throughppa:smathot/opensesame-kuhn.Alternatively, you can simply insert the following
inline_scriptat places where you want to force the flush from happening:Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!