-
Notifications
You must be signed in to change notification settings - Fork 8
/
test_slideScale.m
49 lines (40 loc) · 1.41 KB
/
test_slideScale.m
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
% Preliminary stuff
% check for Opengl compatibility, abort otherwise:
AssertOpenGL;
% Hiding the mourse cursor
HideCursor;
KbName('UnifyKeyNames');
% Back ground colour
bgColor = [128 128 128];
% Get information about the screen and set general things
Screen('Preference', 'SuppressAllWarnings',1);
Screen('Preference', 'SkipSyncTests', 1);
% Creating screen etc.
[myScreen, rect] = Screen('OpenWindow', 0, bgColor);
% Input for slide scale
question = 'Did you like the picture?';
endPoints = {'no', 'yes'};
% The code below creates as slide scale form 0 to 100 for keyboard use with
% left starting position. The left and right control keys are used to
% control the slider and enter is used to log the response.
[position, RT, answer] = slideScale(myScreen, ...
question, ...
rect, ...
endPoints, ...
'device', 'keyboard', ...
'stepsize', 10, ...
'responseKeys', [KbName('return') KbName('LeftControl') KbName('RightControl')], ...
'startposition', 'left', ...
'range', 2);
% The code below creates as slide scale form -100 to 100 for nouse use with
% right starting position. Length of scale is 99%.
[position, RT, answer] = slideScale(myScreen, ...
question, ...
rect, ...
endPoints, ...
'scalalength', 0.99, ...
'device', 'mouse', ...
'startposition', 'right', ...
'range', 1);
% Close window
Screen('CloseAll')