问题
I want my own Ctrl+Z handler called while in zoom mode rather than the default handler. I found this article on Undocumented Matlab and tried this:
function zoomIn_OnCallback(hObject, eventdata, handles)
set(handles.image_handle, 'ButtonDownFcn', []);
zoom on;
[handles.mode_manager.WindowListenerHandles.Enabled] = deal(false);
handles.theGui.WindowKeyPressFcn = [];
handles.theGui.KeyPressFcn = @theGui_KeyPressFcn;
end
The code executes, but doesn't override the Ctrl+Z behavior of zoom mode.
I thought I exactly followed the example code from Undocumented Matlab, but obviously something isn't right.
来源:https://stackoverflow.com/questions/38987567/overriding-ctrlz-behavior-in-matlab-zoom-mode