Log response dúring video
Hi everyone,
I am trying to get something fairly simple done, but i just cannot seem to get it to work.
I want to record any button presses dúring the playback of a video. I know i cannot do it throguh coroutine, and have tried it through inline script but just do not seem to get anywhere. I have gone through the manuals and tutorials.
Can anyone help me?
*Also i would like to continue to the next sequence after a button is pressed.
Comments
Hi,
Capturing key presses during video playback is quite straightforward. If you use the
media_player_mpy, you can set duration to 'Sound' and 'Call custom code' to 'on keypress'. Once you've done that, your custom Python code is executed whenever a key is pressed.As explained in the
media_player_mpyhelp file (which you get if you click on the item's help button), theeventsvariable is eitherNoneor atype, valuetuple. So you have all in the information you need.The snippet below prints out each event (i.e. each key press).
But you also have to decide how you want key presses to be recorded. Do you want some kind of event-based log file? Or do you have something else in mind?
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!