The logic would be to enable a timer that will perform a certain action repetitivly invoked from the mousedown event. Set its interval. Then in the accompaning mouseup event you can disable the timer and it will stop firing.