Collecting responses on RSVP paradigm


I need to run a RSVP experiment, so I’m trying to implement the code suggested by Mario Kleiner in a previous thread to collect the responses. Here what Mario suggested:

startTime = Sreen(‘Flip’, window); % Onset of white square?
% Draw black stuff…
blankStart = Screen(‘Flip’, window, startTime + whiteDuration);
endTime = Screen(‘Flip’, window, startTime + totalStimDuration);

% Get all first key press times since KbQueueFlush():
[~, firstPress] = KbQueueCheck();
if (firstPress(spaceKey) >= startTime) && (firstPress(spaceKey) <= startTime + totalStimDuration)
% Valid ‘space’ key response within the totalStimDuration interval:
RT = firstPress(spaceKey) - startTime;
% No space press or outside response interval:
RT = 0;

I have added “PsychHID(‘KbQueueCreate’)” at the beginning of my code. However, I’m getting the following error message when the code gets to KbQueueCheck:
Error using KbQueueCheck
Keyboard queue for device NaN already in use by GetChar () et al. Use of GetChar and keyboard queues is mutually exclusive!

I’m using Windows 10 and Matlab 2022. Any hint on how to solve this would be very much appreciated.

Please post your paid support authentication token
help PsychPaidSupportAndServices

Hi Mario,

It seems that I found the solution using KbQueueReserve.

Regarding your authentication request, our lab has no token at the moment, but our intention is to allocate some budget for the PTB support.


That’s almost certainly wrong. See what KbQueueCreate gives you. And read help ListenChar and help GetChar carefully if you use those instructions, as I assume you do.

I’m always surprised that people don’t carefully read the help for the functions they are using in their scripts. Isn’t it an obvious thought that people would want to know what they are telling their computers to do during data collection, and what caveats exist, before running scripts on their subjects? How can one trust the data collected with a script that one stitched together without knowing what all the instructions do?


Hi Mario,

We are new to Psychtoolbox, we literally started running experiments in our lab using this toolbox a few weeks ago. We have used Cogent and E-prime before, yet I know PTB is quite popular and I have seen it in other labs. We understood this was an open source tool and hence there would be a community of people behind helping each other with queries, etc, such as the one I posted here. It seems this is not the case - the air seems a bit unhealthy here.

We also very recently heard about the paid support option. Even though the 30 minutes of offered support per year are kind of amusing, we are looking to allocate some budget to support PTB.


I always wondered if somebody still used Cogent probably two decades after its “best before” date, brave!

The part with popular and open-source you got right, with >> 100.000 installations and > 30.000 citations – And for very good reasons.

The “hence” is where you are mistaken: In a perfect fantasy world out of the Star Trek universe that would be true. In a good world, or in reality with really really big open-source projects like Linux, or other open-source stuff that makes (or saves) big companies like Apple, Facebook, Google, Microsoft, Amazon, Netflix, Samsung, Panasonic, and almost every SmartPhone, Tablet, Home appliance, SmartThings vendor, database manufacturer, …, the banking and insurance sector, super-computing, military, embedded devices, and so on and so on, big money, and they actually do understand the return-of-investment and fantastic deal they get, or with smaller scale projects, where decent people with a functioning brain are involved, there might still be some good ratio between active contributors (aka a community) and passive-consumers.

Or people and companies contribute financially, out of decency, or likely more due to a basic ability for long-term thinking, and fund people to do the work you hoped for.

But this is “brain science” where the vast majority of over 99.5% of all users prefer to free-ride and contribute absolutely nothing back, neither in work nor in money, they only take. Except maybe a lame thank you if one is “lucky”, or some smug and uninformed comments if one is less lucky, just to make one regret being helpful and trying to do the right thing.

In case of Psychtoolbox there’s maybe a handful of volunteers who behave like good community members towards the ten-thousands of free-riders. Many of the free-riders don’t even bother to read the Howto for how to ask questions here, or do their homework, to make the unpaid thankless “jobs” of the few volunteers and myself a bit easier. This despite a wealth of information being presented on the website and in our docs and at the end of each Psychtoolbox installation about how to behave well. And myself, as only person who is now (poorly) paid for working on PTB, doing 99.5% of all the work, after working on it tirelessly for free for over 15 years. And a few dozen (less than 0.5%) labs who throw us some pennies, not even enough to pay a tenths of the operating costs.

Not that other similar projects have more supportive user bases, they don’t, from what I’ve heard, comparing notes. They currently manage by having less users and use cases (thereby less non-paying free-riders), thereby lower workload, and sometimes some luck with some funding from somewhere. Or a lucky financial break, by having just the right tool at the right moment when a world-wide pandemic forces in-person lab shutdowns and being able to force users to pay for their services…

There’s a reason why you get a lot of google hits when searching for terms like “open source funding crisis” or “open source maintainers burning out”. E.g., this one, which i just skimmed, not necessarily the best description, just one of many too many, the first that showed up in a google search, to make my point:

What’s the price again of a single-person one year runtime E-Prime license that as far as I know offers a fraction of the functionality and flexibility of our free software?

It’s good that you are “…looking to allocate…” [I noted the future tense], but forgive me to assume, based on a sample size of n=ten-thousands, your lab will fall into the 99.5% bucket instead of the 0.5% bucket of behavior, until proven otherwise. If I’d get a thousand dollars from each person who said the are “…looking…,.” or “…intend to…” allocate some budget for funding us and didn’t follow through, I’d be rich by now and be able to do this work as a hobby again.

And this ends this little exchange. Closing this topic.