OpenCvSharp.UserInterface.CvWindowEx.WaitKey C# (CSharp) Méthode

WaitKey() public static méthode

Waits for a pressed key
public static WaitKey ( int delay ) : Keys
delay int
Résultat Keys
        public static Keys WaitKey(int delay)
        {
            Keys result = Keys.None;
            Stopwatch watch = Stopwatch.StartNew();

            foreach (CvWindowEx w in windows)
            {
                w.StartKeyCheck();
            }
            while (!ClosedAllWindows() && (delay <= 0 || watch.ElapsedMilliseconds < delay))
            {
                Application.DoEvents();
                Thread.Sleep(1);
                foreach (CvWindowEx w in windows)
                {
                    if (!w.Created)
                    {
                        continue;
                    }
                    Keys key = w.GetPressedKey();
                    if (key != Keys.None)
                    {
                        result = key;
                        goto END_WHILE;
                    }
                }                
            }
        END_WHILE:
            foreach (CvWindowEx w in windows)
            {
                w.EndKeyCheck();
            }

            return result;
        }

Same methods

CvWindowEx::WaitKey ( ) : Keys