Howdy, Stranger!

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

Supported by

Changing the default Esc + Q buttons to quit.

Hello everyone! We are running experiments with children in OpenSesame. After testing it on a few classes, we noticed that some children press random keys on the keyboard, one even exited the experiment herself. To avoid this, is there a way to change the default Esc + Q to exit? Possibly making it somewhat more complicated for them to exit?

Thank you in advance!



  • Hi Simona,

    When the Escape key is pressed, the exp.pause() function is called. By default, this function shows a pause screen, waits for a key press, aborts the experiment if the user presses Q, and resumes otherwise.

    But you can override this behavior with a custom function that can do whatever you want. For example, if you add the following to the prepare phase at the very start of the experiment, then pressing Escape will no longer do anything.

    def my_custom_pause_function():
        print('I don\'t do anything right now, but I could!')
    exp.pause = my_custom_pause_function

    It also possible to change OpenSesame such that Escape no longer calls exp.pause(). But that's a bit more involved, and probably not necessary in your case.

    I hope this helps!


  • Hi Sebastiaan!

    Thank you for your reply. That's perfect, that way we can make it *even* more complicated to exit the experiment for the kids!

    Thanks again!


Sign In or Register to comment.