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

1 回表示 (過去 30 日間)
Chelsea
Chelsea 2015 年 1 月 15 日
コメント済み: yuqi xue 2017 年 2 月 24 日
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 件のコメント
yuqi xue
yuqi xue 2017 年 2 月 24 日
try this:
startTime= WaitSecs(0);
KbWait([], 0 ,startTime+2)

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeTiming and presenting 2D and 3D stimuli についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by