/usr/share/psychtoolbox-3/PsychHardware/FORP/FORPWait.m is in psychtoolbox-3-common 3.0.11.20131230.dfsg1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | function [KeyPressed,EventTime] = FORPWait(TimeToWait)
% FORPWait Checks for the specified amount of time, if a button of a FORP device
% (tested for HH-5-CYL) is pressed , returns if a button has been
% pressed or specified amount of time has passed.
%
% Usage:
%
% [KeyPressed,EventTime] = FORPWait([Seconds])
%
% Arguments:
%
% Seconds Maximum time to check for buttonpresses in seconds.
% Default's to 'wait forever' if not provided.
%
%
%
% Returns the keycode (KeyPressed) of the pressed button and the
% time (EventTime) of the status check.
%
%
% KeyPressed KeyCode of the Pressed Button or empty value if
% waiting timed out without any key press.
%
%
% EventTime Time of keypress as returned by GetSecs.
%
%
% IMPORTANT NOTE:
%
% Current-Designs FORP Device (HH-5-CYL) does not return any values for
% manufacturer or product, so i used the VendorID returned by
% PsychHID('Devices') for the HH-5-CYL.(ATM i do no really know if the
% VendorID has unique values).
% Another issue i had to solve was a ?bug? using 'GetReport'. I had to
% close the Callbackhandlers to the current device by calling
% 'ReceiveReportsStop' before calling 'GetReport' on another device.
% If you have got any advice for a better way solve those problems, feel
% free to let me know:
%
% Florian Stendel
% Visual Processing Lab
% Universitaets - Augenklinik Magdeburg
% Leipziger Strasse 44
% 39120 Magdeburg
% Tel: 0049 (0)391 67 21723
% Email: vincentdhs@gmx.de
%
%
% 09/10/06 fs Wrote it.
% 19/10/06 fs Added some further improvements suggested by Mario
% Kleiner.
KeyPressed = '';
keydata = [];
if nargin < 1
TimeToWait=inf;
end
deadline = GetSecs + TimeToWait;
while (deadline > GetSecs) && isempty(KeyPressed)
[KeyPressed,EventTime] = FORPCheck;
end
return;
end
|