I want to be able to do the following after plotting a figure: 1) Click the zoom button and zoom in on an axes 2) Use a keyboard key KeyPressFcn while the zoom button in the toolbar is still depressed.
Unfortunately, I can't get the fix to work. The only way to get my figure KeyPressFcn working again is to de-select the zoom icon. Here's my code:
figure_handle = figure(1);
hManager = uigetmodemanager(figure_handle);
[hManager.WindowListenerHandles.Enabled] = deal(false);
set(figure_handle, 'WindowKeyPressFcn', );
set(figure_handle, 'KeyPressFcn', @(hobj,evnt) myKeyPress(hobj,evnt));
function myKeyPress(hfig, eventDat)
Any idea what I'm doing wrong? I want the figure key presses to still work if the user tries to zoom/pan an axes, without having to de-select that operation when they're done.