How to ignore repeating keyboard event
See original GitHub issueI am trying to migrate my Application from react-hotkeys
.
I am wondering by any chance to have a options like
ignoreRepeatedEventsWhenKeyHeldDown: boolean
in react-hotkeys-hook?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to disable repetitive keydown in JavaScript - Stack Overflow
To ignore key events caused by key repeats, keep track of which keys are pressed during the keydown and keyup events.
Read more >KeyboardEvent.repeat - Web APIs - MDN Web Docs
The repeat read-only property of the KeyboardEvent interface returns a boolean value that is true if the given key is being held down...
Read more >Set how quickly a key repeats on Mac - Apple Support
On your Mac, choose Apple menu > System Settings, then click Keyboard in the sidebar. · Drag the “Delay until repeat” slider on...
Read more >Manage repeated key presses - Official Ubuntu Documentation
Manage repeated key presses ; Open the Activities overview and start typing Settings. ; Click on Settings. ; Click Accessibility in the sidebar...
Read more >How to avoid clicked key auto-repeat in blazor server?
From the Built-in event arguments, we can see the KeyboardEventArgs class has the Repeat property, if a key has been depressed long enough...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah I was trying to achieve something similar to what @Taymindis was looking for I believe. Even with the
{keyup: true}
config, you still get loads of repeated function calls if you hold the specific key combo. I wanted the function to be called just once, irregardless of how long the user presses/holds the specific key combo.For anyone looking to accomplish this:
(e) => !e.repeat && exampleFunc()
, without the keyup config in the next argument, seems to work.I’m trying to get my configuration to fire when the combo is held.
Was this changed in a recent version?