Timed Event in TextField Keydown/Keyup

Hi Folks,

I would like to create a mechanism tied to the Keyup event in a TextField that monitors keystrokes and calls a method after a period of time has passed since the last keystroke. The idea is to check for a valid entry without requiring the user do do more than type in the field.

What I’ve thought of is a timer that is started with the user’s first keydown with a period of 2500ms. The Timer would be set to mode 1 and each time there’s a Keyup. the timer is set to mode 0 and then back to mode 1, resetting its period.

Any better ideas floating around out there?

That’s the right approach. I’d recommend Timer.Reset to reduce the code though.