% exampleKb.m % Wait for a key with KbWait. % a simplified version of KbDemo by IF 4/2007 WaitSecs(0.5); disp('Testing KbWait: hit any key. Just once.'); startSecs = GetSecs; timeSecs = KbWait; [keyIsDown, t, keyCode ] = KbCheck; str=[KbName(keyCode), ' typed at time ', ... num2str(timeSecs - startSecs), ' seconds']; disp(str);