Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Log response dúring video

edited April 2017 in OpenSesame

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.


  • 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_mpy help file (which you get if you click on the item's help button), the events variable is either None or a type, value tuple. So you have all in the information you need.

    The snippet below prints out each event (i.e. each key press).

    if event is not None:
        event_type, event_value = event
        if event_type == 'key' and event_value == 'space':
            continue_playback = False

    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?


    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

Sign In or Register to comment.