react-keydown icon indicating copy to clipboard operation
react-keydown copied to clipboard

Disable repeat?

Open gbishop opened this issue 9 years ago • 2 comments

My users (mostly children) sometimes hold the key down (on purpose or because they can't lift their hand off the switch because of disability) thus triggering key repeat. I typically avoid this by binding keyup to clear a flag set on keydown and ignoring the keydown event if the flag is set.

I don't see that in your package but it looks like it would be simple to add. If you agree, I may try hacking it to produce a pull request.

gbishop avatar Aug 17 '16 19:08 gbishop

Sure that'd be nice @gbishop, probably with a sensible default and then an option to modify the behavior per binding or something.

glortho avatar Aug 18 '16 18:08 glortho

Nothing needs to be changed, use therepeat prop within the KeyboardEvent param to disable repeated keys.

image

image

Hope helps.

fortranlee avatar Nov 23 '17 02:11 fortranlee