Well i found another solution:
Is it possible change ROIClicked to PressEnter ?
I = imread('*.jpeg');
imshow(I);
h = drawline;
pos = customWait(h);
function pos = customWait(hROI)
% Listen for mouse clicks on the ROI
l = addlistener(hROI,'ROIClicked',@clickCallback);
% Block program execution
uiwait;
% Remove listener
delete(l);
% Return the current position
pos = hROI.Position;
end
function clickCallback(~,evt)
if strcmp(evt.SelectionType,'double')
uiresume;
end
end