KbDemo not working on Catalina, allowing input monitoring does not help

Hi all - I’m currently running MacOS Catalina Version10.15.4. I am having trouble with Psychtoolbox registering my keyboard.

I’m running Psychtoolbox version 3.0.15 with Matlab R2019a Update 8. I’ve read a number of threads where people were having the same problems because of Catalina (https://discourse.psychopy.org/t/keyboard-psychtoolbox-hid-failing-with-mac-os-catalina-update/9389/21), where the fix for them was going to System Preferences/Privacy Settings/Input monitoring and allowing input monitoring for the Matlab I am running. I’ve allowed this - however I am still running into problems trying to get Matlab to register my keyboard.

Here I will list of some troubleshooting responses for context:

  1. When I run

devices = PsychHID(‘devices’)

’The ‘devices’ structure includes my keyboard (internal Apple keyboard) as the fourth device. When I run PsychHID(‘KbQueueCreate’) with deviceNumber = 4, I get the following error:

PsychHID(‘KbQueueCreate’, deviceNumber)


error: PsychError_system

general description: Error reported by a system call

specific description: Failed to create event queue for detecting key press.

module name: PsychHID

subfunction call: KbQueueCreate

file name: OSX/PsychHID/PsychHIDStandardInterfaces.c

function name: PsychHIDOSKbQueueCreate

line number: 956

Error using PsychHID

See error message printed above.

When I run KbDemo, it will not accept key presses.

  1. It may be important to note that when listing my devices, a device also designated as a ‘keyboard’ is listed, without any credentials it seems. This is shown as the second line in this structure:

  2. I have the same problem with Psychtoolbox 3.0.16 and with Matlab2020a.

Has anyone experienced this problem and know a solution? Thank you!

PTB 3.0.15 is end of life and unsupported. 3.0.16 had multiple workarounds in keyboard handling implemented for the broken pile of shit that is Catalina.

Does KbQueueDemo work? Does it work with the index returned by GetKeyboardIndices? If setting permissions for input monitoring doesn’t help, then i don’t know. I know this stuff should work on 10.15.3, but haven’t upgraded to 10.15.4 after 10.15.3 broke all external video outputs on my machine, this time with a botched firmware update, not only for Catalina but also for Mojave and Linux – a truly outstanding demonstration of engineering incompetence that now makes productive work and testing almost impossible on my only Catalina test machine. I’m too scared atm. to upgrade to 10.15.4, but i just read that this one additionally crashes if you try to copy big files from a to b.

Notice that Apple also broke that mechanism if you update Matlab, because their whole new security authorization workflow was designed by somebody without a functioning brain. You have to take away the permissions and set them again after each minor Matlab update. See the end of:

This is especially ironic, because Apple ran ads ridiculing Microsoft for doing exactly the same thing in Windows Vista that Apple now does ten years later in Catalina, just now with an even worse UI design. For your entertainment:

Thank you for the feedback. I figured out that I had to redownload Matlab R2019a, and then re-allow the input monitoring once again for it to work on Catalina 10.15.4. This was with Psychtoolbox version 3.0.16.

Thanks again!