MATLAB: Does the KeyPressFcn property of a figure not work in MATLAB for the MAC

keypressfcnmacMATLABunresponsive

Why does the KeyPressFcn property of a figure not work in MATLAB for the MAC?
When I create a figure in MATLAB with a uicontrol on it and specify a KeyPressFcn callback, the callback does not execute consistently. For example if I use the following code:
figure
set(gcf,'KeyPress','disp(''Hello'')')
uicontrol('Style','text')
The KeyPressFcn callback fails to respond consistently. More specifically, when I press the arrow
keys, it will only capture the first key press and ignore subsequent keypresses until I click on the figure again.

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
This has been verified as a bug in MATLAB in the way that the KeyPressFcn callback of a figure is handled on a MAC.
There are currently no known workarounds.