Howdy, Stranger!

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

Supported by

Need help with looping video with record for number of key pressed and duration

Hi, I need help in designing an experiment for my thesis.

As a total noob in a script world, and just barely using OpenSesame GUI recently, I need to design an experiment with a looping video played for around 30 seconds while the program record the number of certain key pressed and the duration of the key pressed. I found this, and it seems to fit my bill, but I can't seem to make it work.

hopefully someone can suggest me how should I begin to work. Thank you


  • edited August 2017


    You'll need to be more specific! What exactly do you want to do, and what kind of information do you want to log? Which keys do you want to log? Do you only want to count the number of times that these keys were pressed, or log each key-down and key-up event separately?

    First think about the details of what you want to do. Once you've established that, we can think about how you can actually do that!


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

  • edited August 2017

    Hi, Sebastian,

    Thank you for the reply, since the experiment that I want to test use a video with certain cues in it, the subject need to press and hold "space" key everytime the cue appeared, the video should play for its full duration, since the cue itself appear for certain amount of time, I need the subject to actually hold "space" key for as long as they think they see the cue (so the record of how long they hold "space" button should represent what they perceived rather than the actual time of the cue), I need to count the number of times "space" got pressed and for how long it got pressed, but if such function doesn't exist then a log of key-down and key-up should suffice.

    The experiment itself should end when the video finished (I change the experiment design from using a looping video to one-time run).

    I am sorry for the late reply, I was trying to work on the experiment myself to no avail and kinda forgot to check the forum, hopefully I can find an answer here.

    Thank you

  • Hi Willy,

    Did you manage? YOur plan is clear now, however, you haven't given any detail what the actual problem is. Any error messages? Funny things appearing on the screen? There are more discussion along the lines of the one you posted in the beginning. Maybe one of the others can help you more. If you need concrete help, please let us know, but currently, it is still not easy to help you.


  • Hi Eduard,

    Thank you for noticing, I currently trying to work with another app developer with knowledge in Android Studio to create the app, it will cost me quite a bit but since I was stuck on opensesame, it seemed to be a better option,

    Up till I gave up, I tried to work with visual stimuli and inline_script from other post (this one,, but the reading seems to be wrong , it doesn't seems to be recording all the keypress and rather just the first key.

    There are some issues regarding the video directly tied to the key press (stopped the video if any key pressed) and if I change it to play up to certain duration it will play it up to the duration and stopped playing while the experiment itself didn't end. At that point I tried installing OpenCV since another post refer it, but I can't really understand how to install and use it, so I decided to look for other option.

    Sorry I didn't follow through the experiment using opensesame.


Sign In or Register to comment.