private bool CanDelete() { if (TypingSW.Elapsed.TotalSeconds > (1 / BackspacesPerSecond)) { TypingSW = Stopwatch.StartNew(); TypingSW.Start(); return(true); } return(false); }
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); }
public TypingControl() { TypingSW.Start(); CursorBlinkingSW.Start(); }