#69 new
Jake Archibald

Repeating function helper

Reported by Jake Archibald | July 20th, 2009 @ 08:47 AM | in 2.0

Something to call an action when the mouse button goes down / key is pressed, then repeatedly until the button is lifted. Something like

repeatAction({
  repeatDelay: 1,
  repeatInterval: 0.5,
  onStart: startCallback,
  onRepeat: repeatingCallback,
  onStop: endCallback
});

Would be nice to have a helper in there to cancel the event when the mouse exits a particular element, although this would apply to mouse repeating more than keyboard events.

Some useful info on keypressing http://unixpapa.com/js/key.html

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A JavaScript Library

Shared Ticket Bins

People watching this ticket

Attachments

Pages