Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

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 http://forum.cogsci.nl/index.php?p=/discussion/37/solved-how-to-log-the-duration-of-a-key-press/p1, 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


  • sebastiaansebastiaan Posts: 2,774
    edited August 4


    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!


    8o5bjw.jpg 23.5K

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

  • edited August 11

    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

  • eduardeduard Posts: 896

    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, http://forum.cogsci.nl/index.php?p=/discussion/37/solved-how-to-log-the-duration-of-a-key-press/p1), 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.