Index: trunk/src/keyboard_callback.m
===================================================================
--- trunk/src/keyboard_callback.m	(revision 71)
+++ trunk/src/keyboard_callback.m	(revision 192)
@@ -2,50 +2,61 @@
 %-----------------------------------
 function keyboard_callback(hObject,eventdata,handleshaxes)
+cur_axes=get(hObject,'CurrentAxes');%current plotting axes of the figure with handle hObject
 xx=double(get(hObject,'CurrentCharacter')); %get the keyboard character
-cur_axes=get(gcbf,'CurrentAxes');
-if ~isempty(cur_axes)
-    xlimit=get(cur_axes,'XLim');
-    ylimit=get(cur_axes,'Ylim');
-    dx=(xlimit(2)-xlimit(1))/10;
-    dy=(ylimit(2)-ylimit(1))/10;
-   
-    if isequal(xx,29)%move arrow right
-        xlimit=xlimit+dx;
-    elseif isequal(xx,28)%move arrow left
-        xlimit=xlimit-dx;
-    elseif isequal(xx,30)%move arrow up
-        ylimit=ylimit+dy;
-    elseif isequal(xx,31)%move arrow down
-        ylimit=ylimit-dy;
-    end
-    set(cur_axes,'XLim',xlimit)
-    set(cur_axes,'YLim',ylimit)
-end
-if ismember(xx,[8 127]) %if the delete or suppr key is pressed, delete the current object 
-    currentobject=gco;
-    huvmat=findobj(allchild(0),'tag','uvmat');
-%     UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface
-    hlist_object=findobj(huvmat,'Tag','list_object_1');
-    ObjIndex=get(hlist_object,'Value')
-    if ObjIndex>1 
-        delete_object(ObjIndex)
-    end
-    if ishandle(currentobject)
-        tag=get(currentobject,'Tag');%tag of the current selected object
-        if isequal(tag,'proj_object')
-            delete_object(currentobject)
+switch xx
+    case {29,28,30,31}    %arrows for displacement
+        if ~isempty(cur_axes)
+            xlimit=get(cur_axes,'XLim');
+            ylimit=get(cur_axes,'Ylim');
+            dx=(xlimit(2)-xlimit(1))/10;
+            dy=(ylimit(2)-ylimit(1))/10;
+            if isequal(xx,29)%move arrow right
+                xlimit=xlimit+dx;
+            elseif isequal(xx,28)%move arrow left
+                xlimit=xlimit-dx;
+            elseif isequal(xx,30)%move arrow up
+                ylimit=ylimit+dy;
+            elseif isequal(xx,31)%move arrow down
+                ylimit=ylimit-dy;
+            end
+            set(cur_axes,'XLim',xlimit)
+            set(cur_axes,'YLim',ylimit)
+            hfig=hObject; %master figure
+            AxeData=get(cur_axes,'UserData');
+            if isfield(AxeData,'ParentRect')% update the position of the parent rectangle representing the field
+                hparentrect=AxeData.ParentRect;
+                rect([1 2])=[xlimit(1) ylimit(1)];
+                rect([3 4])=[xlimit(2)-xlimit(1) ylimit(2)-ylimit(1)];
+                set(hparentrect,'Position',rect)
+                hfig=get(hparentrect,'parent');
+                hfig=get(hfig,'parent');
+            elseif isfield(AxeData,'LimEditBox')&& isequal(AxeData.LimEditBox,1)% update display of the GUI containing the axis (uvmat or view_field)
+                hh=guidata(hfig);
+                if isfield(hh,'MinX')
+                    set(hh.MinX,'String',num2str(xlimit(1)))
+                    set(hh.MaxX,'String',num2str(xlimit(2)))
+                    set(hh.MinY,'String',num2str(ylimit(1)))
+                    set(hh.MaxY,'String',num2str(ylimit(2)))
+                end
+            end
         end
-    end
-elseif isequal(xx,112)%  key 'p'
-    uvmat('runplus_Callback',hObject,eventdata,handleshaxes)
-elseif isequal(xx,109)%  key 'm'
-    uvmat('runmin_Callback',hObject,eventdata,handleshaxes)
+    case {8, 127} %if the delete or suppr key is pressed, delete the current object 
+        currentobject=gco;
+        huvmat=findobj(allchild(0),'tag','uvmat');
+        hlist_object=findobj(huvmat,'Tag','list_object_1');
+        ObjIndex=get(hlist_object,'Value');
+        if ObjIndex>1 
+            delete_object(ObjIndex)
+        end
+        if ishandle(currentobject)
+            tag=get(currentobject,'Tag');%tag of the current selected object
+            if isequal(tag,'proj_object')
+                delete_object(currentobject)
+            end
+        end
+    case 112%  key 'p'
+        uvmat('runplus_Callback',hObject,eventdata,handleshaxes)
+    case 109%  key 'm'
+        uvmat('runmin_Callback',hObject,eventdata,handleshaxes)
 end
 
-AxeData=get(cur_axes,'UserData');
-if isfield(AxeData,'ParentRect')% update the position of the parent rectangle represneting the field
-    hparentrect=AxeData.ParentRect;
-    rect([1 2])=[xlimit(1) ylimit(1)];
-    rect([3 4])=[xlimit(2)-xlimit(1) ylimit(2)-ylimit(1)];
-    set(hparentrect,'Position',rect)
-end
