In JQuery I know that there is a function called keydown
, but this does allow me to set a timeout each time the callback is called.
$(document).keydown(() => {
//do stuff
});
The //do stuff
calls too fast each time. I want to call this every 500 milliseconds while the user is holding a key. Is there any way to do this?