function repeat3 (in)
  persistent ht;
  if (~nargin)
    ht = text (0.5, 0.5, '0', 'backgroundcolor', 'm', ...
               'buttondownfcn','repeat3(1)');
  else
    setappdata(gcf,'bdown',1);
    set(gcf,'WindowButtonUpFcn','setappdata(gcf,''bdown'',0);');
    while getappdata(gcf,'bdown')                            % loop until user lets go of mouse
       incr = 1 - 2*strcmp(get(gcf,'SelectionType'),'alt');  % left/right button goes up/down
       set(ht,'string',num2str(str2num(get(ht,'string'))+incr));
       pause(.1);
    end
  end
end
