I am using the .one() function on a keydown to stop the function inside this running continuously if the the user holds down the key.
The problem is, the .one() function only runs once, and will only work again when I refresh the page.
$(document).one('keydown',function(e){
if (e.keyCode == 37) {
prev();
return false;
}
});
Is there a way to get around this, or an alternative method?
I get that .one() means once, and that this is the point of the function. I am trying to get it to run just once per keydown.