예제 #1
0
        private bool CanDelete()
        {
            if (TypingSW.Elapsed.TotalSeconds > (1 / BackspacesPerSecond))
            {
                TypingSW = Stopwatch.StartNew();
                TypingSW.Start();
                return(true);
            }

            return(false);
        }
예제 #2
0
        private bool CanType(char letter)
        {
            if (LetterSequence.Length >= MaxLength)
            {
                return(false);
            }

            if (LetterSequence.Length == 0)
            {
                if (TypingSW.Elapsed.TotalSeconds > (1 / UniqueKSPS))
                {
                    TypingSW = Stopwatch.StartNew();
                    TypingSW.Start();
                    return(true);
                }
            }

            if (letter == LetterSequence[LetterSequence.Length - 1])
            {
                //the keystroke is repetitive
                if (TypingSW.Elapsed.TotalSeconds > (1 / RepetitiveKSPS))
                {
                    TypingSW = Stopwatch.StartNew();
                    TypingSW.Start();
                    return(true);
                }
            }
            else
            {
                //the keystroke is unique
                if (TypingSW.Elapsed.TotalSeconds > (1 / UniqueKSPS))
                {
                    TypingSW = Stopwatch.StartNew();
                    TypingSW.Start();
                    return(true);
                }
            }

            return(false);
        }
예제 #3
0
 public TypingControl()
 {
     TypingSW.Start();
     CursorBlinkingSW.Start();
 }