File: KbQueueRelease.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (33 lines) | stat: -rw-r--r-- 986 bytes parent folder | download
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
32
33
function KbQueueRelease(deviceIndex)
% KbQueueRelease([deviceIndex])
%
% Releases queue-associated resources; once called, KbQueueCreate
% must be invoked before using any of the other routines
%
% This routine is called automatically at clean-up (e.g., when 
% 'clear mex' is invoked and can be omitted expense of keeping 
% memory allocated and an additional thread running unnecessarily
%_________________________________________________________________________
%
% See also: KbQueueCreate, KbQueueStart, KbQueueStop, KbQueueCheck,
%            KbQueueWait, KbQueueFlush, KbQueueRelease

% 8/19/07    rpw  Wrote it.
% 8/23/07    rpw  Modifications to add KbQueueFlush

if nargin < 1
    deviceIndex = [];
end

% Try to release keyboard queue for 'deviceIndex' from our exclusive use:
if ~KbQueueReserve(3, 2, deviceIndex)
  return;
end

KbQueueReserve(2, 2, deviceIndex);

if nargin == 0
  PsychHID('KbQueueRelease');
elseif nargin > 0
  PsychHID('KbQueueRelease', deviceIndex);
end