KbWait() - Wait for response for x # seconds or time out?

3 vues (au cours des 30 derniers jours)
Chelsea
Chelsea le 15 Jan 2015
Commenté : yuqi xue le 24 Fév 2017
Hi,
I'm trying to create code where I wait for a user's key response for 5 seconds. If there's no response in 5 seconds, the screen (using Psychtoolbox) should advance.
I've tried KbWait(5), as in 5 seconds, but of course I think this is too good to be true.
Is there anything else I should try?
Thanks so much!
  1 commentaire
yuqi xue
yuqi xue le 24 Fév 2017
try this:
startTime= WaitSecs(0);
KbWait([], 0 ,startTime+2)

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Timing and presenting 2D and 3D stimuli dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by