¡@

Home 

2014/10/16 ¤W¤È 12:07:03

jquery Programming Glossary: repeatstate

Cross-browser way to get automatically repeating keydown events when key is held down

http://stackoverflow.com/questions/14027818/cross-browser-way-to-get-automatically-repeating-keydown-events-when-key-is-held

event is determined by the time value set on setInterval below function repeatCallback key #result .append key var repeatState document.body .keydown function e var key e.which if no time yet for this key then start one if repeatState key make copy.. key var repeatState document.body .keydown function e var key e.which if no time yet for this key then start one if repeatState key make copy of key code because `e` gets reused by other events in IE so it won't be preserved repeatState key setInterval.. one if repeatState key make copy of key code because `e` gets reused by other events in IE so it won't be preserved repeatState key setInterval function repeatCallback key 125 else nothing really to do here The key was pressed but there is already..