Debounced Keyboard Input

Debouncing and throttling are two essential techniques for controlling the rate at which a function is called. There are many demos online that you can look at. I particularly like this one, which inspired the page you're looking at right now.

I'm not going to re-explain the concepts here - there are many excellent resources for that. This page is just a demo of the debounce and throttle functions specifically with keyboard input - which I was unable to find elsewhere online.

Play around with the delay time, type some words, and have fun with it!

I find that I can type words I know well (like my name) and have it fully debounced down to a delay of ~150, but for other words or things like email addresses, I need a debounce around 250 if I want there to only be one event.

Normal


ms

Throttled

Debounced