File: KbReleaseWait.m

package info (click to toggle)
psychtoolbox-3 3.0.14.20170103%2Bgit6-g605ff5c.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 103,044 kB
  • ctags: 69,483
  • sloc: ansic: 167,371; cpp: 11,232; objc: 4,708; sh: 1,875; python: 383; php: 344; makefile: 207; java: 113
file content (31 lines) | stat: -rw-r--r-- 1,135 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function [secs, keyCode, deltaSecs] = KbReleaseWait(deviceNumber, varargin)
% [secs, keyCode, deltaSecs] = KbReleaseWait([deviceNumber][, untilTime=inf][, more optional args for KbWait]);
%
% KbReleaseWait waits until all keys on the keyboard are released.
%
% It also returns if the optional deadline 'untilTime' is reached.
%
% This is a convenience wrapper, doing the same thing as
% KbWait(deviceNumber, 1, ...); so read "help KbWait" for details about
% operation and returned values.
%
% You'll typically use this function to make sure that all keys are idle
% before you start some new trial that collects keyboard responses, after
% you've used KbCheck, KbWait or KbPressWait for collecting a response. A
% different approach is to use KbStrokeWait.
%
% See also: KbPressWait, KbReleaseWait, KbWait, KbCheck, KbStrokeWait.

% History:
% 9.3.2008 Written. (MK)

% Assign default device [] if none specified:
if nargin < 1
    deviceNumber = [];
end

% Just call KbWait in 'forWhat' mode 1, passing along all input args and
% returning all output args:
[secs, keyCode, deltaSecs] = KbWait(deviceNumber, 1, varargin{:});

return;