GetEchoString Not Appearing

Hi all!

Hope all is well. I am new to the PsychToolbox, and have been trying to create a full screen string response area. But I seem to be running into an issue getting the text to appear on the screen.

It comes up as a white screen without displaying my prompt text or the text the user enters. I have looked through the documentation and forums, but I still seem to be missing something. If anyone might know where I am making a mistake it would be greatly appreciated. I adapted this off one of the PTB3 tutorials.

On Windows 10, MATLABR2021a, latest PsychToolbox 3

Thank you.

% Clear before starting program
sca;
close all;
clearvars;

% Initialize the base setup
PsychDefaultSetup(2);

%Generate screen numbers for multiple displays
screens = Screen(‘Screens’);

%Choosing minimum will display this on the main laptop screen;
screenNumber = min(screens);

% Define black and white and grey luminance
white = WhiteIndex(screenNumber);
black = BlackIndex(screenNumber);
grey = white / 2;

% Open an on screen window
[window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber);

% This function call will give use the same information as contained in
% “windowRect”
rect = Screen(‘Rect’, window);

% Get the size of the on screen window in pixels, these are the last two
% numbers in “windowRect” and “rect”
[screenXpixels, screenYpixels] = Screen(‘WindowSize’, window);

% Get the centre coordinate of the window in pixels.
% xCenter = screenXpixels / 2
% yCenter = screenYpixels / 2
[xCenter, yCenter] = RectCenter(windowRect);

%ScreenSize as reported by the system

[width, height] = Screen(‘DisplaySize’, screenNumber);

%Function to get user input and display on the screen
[response,temp] = GetEchoString(window,“Please enter a response.”,xCenter,yCenter,black,[255,255,255]);

% Wait for a keyboard button press to exit

KbStrokeWait;

sca;

use single quotes, not double quotes, for the string argument to GetEchoString:
GetEchoString(window,‘Please enter a response.’,

1 Like