function out = escapeSequence(key)

beginTime = GetSecs;
responded = 0;
out = 0;
if isequal(upper(key), 'Q')
   while (~responded) & (GetSecs-beginTime < 0.5)
      while CharAvail
         key = GetChar;
      end
      key = GetChar;
      if isequal(upper(key), 'P')
         responded = 1;
         out = 1;
      end
   end
else
   out = 0;
end