Skip to content

Commit c186e4c

Browse files
committed
keysOfInterest = zeros(1,256);
1 parent bcca2cf commit c186e4c

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

demos/CPP_getResponseDemo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
end
108108

109109
fprintf('\n %s was %s at time %.3f seconds\n', ...
110-
responseEvents(iEvent).key_name, ...
110+
responseEvents(iEvent).keyName, ...
111111
eventType, ...
112112
responseEvents(iEvent).onset - startSecs);
113113

getResponse.m

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
function responseEvents = getResponse(action, deviceNumber, cfg, getOnlyPress)
2-
% wrapper function to use KbQueue
3-
% The queue will be listening to key presses on the response box as defined
4-
% in the cfg structure : see setParameters for more details.
2+
% Wrapper function to use KbQueue
53
%
6-
% Check the CPP_getResponseDemo for a quick script on how to use it.
4+
% The queue will be listening to key presses on a keyboard device:
5+
% cfg.keyboard.responseBox or cfg.keyboard.keyboard are 2 main examples.
6+
%
7+
% When no deviceNumber is set then it will listen to the default device.
78
%
9+
% Check the CPP_getResponseDemo for a quick script on how to use it.
810
%
911
%
1012
% INPUT
1113
%
1214
% - action: Defines what we want the function to do
1315
% - init: to initialise the queue
1416
% - start: to start listening to keypresses
15-
% - check:
16-
% - flush:
17-
% - stop:
17+
% - check: checks all the key presses events since 'start', or since last
18+
% 'check' or 'flush' (whichever was the most recent)
19+
% - flush: empties the queue of events in case you want to restart from a clean
20+
% queue
21+
% - stop: stops listening to key presses
1822
%
1923
% - getOnlyPress: if set to true the function will only return the key presses and
2024
% will not return when the keys were released (default=true)
@@ -149,7 +153,7 @@
149153
responseEvents(iEvent,1).onset = event.Time;
150154
responseEvents(iEvent,1).trial_type = 'response';
151155
responseEvents(iEvent,1).duration = 0;
152-
responseEvents(iEvent,1).key_name = KbName(event.Keycode);
156+
responseEvents(iEvent,1).keyName = KbName(event.Keycode);
153157
responseEvents(iEvent,1).pressed = event.Pressed;
154158

155159
iEvent = iEvent + 1;

0 commit comments

Comments
 (0)