function keypress(ViewerObj)
%KEYPRESS  LTI Viewer keypressfcn

%   Author(s): A. DiVergilio
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.2 $  $Date: 2000/06/14 20:03:13 $

Key = abs(get(ViewerObj.Handle,'CurrentCharacter'));

if ~isempty(Key)
   switch Key
   case 27 %---<Esc>
      %---Only clear if we're not in the middle of a zoom
      if isempty(get(ViewerObj.Handle,'WindowButtonUpFcn'))
         %---For each response object, turn zoom off
         for n=1:length(ViewerObj.UIContextMenu)
            set(get(ViewerObj.UIContextMenu(n),'UserData'),'Zoom','off');
         end
      end
   end
end
