The function KbName has difficulties identifying keys. I run Matlab R2019b on Ubuntu 18.04 LTS and PTB 3.0.17, with two keyboards installed on my computer (English and Hebrew). However, I come across this error every other time I open Matlab it seems like to problem repeats itself, and KbName cease to function correctly:
KbName(‘UnifyKeyNames’); KbName(‘y’)
Error using KbName (line 870)
Key name “y” not recognized. Maybe you need to add KbName(‘UnifyKeyNames’); to top of your script?
I think the function has some difficulties with the key mappings on my machine. I found somewhere (sorry, I don’t remember where it was) that I can use the setxkbmap function to set key mappings so I added this line to my script, which doesn’t change anything in terms of what I as a user experience.
system(“setxkbmap ‘il, us’”);
This seemed to randomly work, but I want to see if I can better understand the problem and find a permanent solution rather then some patchwork solution. Did anyone else overcome this problem? Any suggestion on how to debug it?