<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: onkeypress and onkeydown firing rate</title>
	<atom:link href="http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/</link>
	<description>Making Web 2.0 More Than a Catchprhase</description>
	<pubDate>Thu, 28 Aug 2008 17:29:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: ajm</title>
		<link>http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/#comment-6391</link>
		<dc:creator>ajm</dc:creator>
		<pubDate>Mon, 02 Jul 2007 15:30:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/#comment-6391</guid>
		<description>I agree on FireBug! I used "console.log()" to log the events firing in my test. I didn't know about "Log Events" though; that's definitely sweet!

onkeydown and onkeypress have now been rendered functionally equivalent in all major browsers and will fire at the same time; they didn't used to be, and I agree that they shouldn't be, too. 

However, I'm not really sure what the semantic difference between a keydown and a keypress would wind up being, and coding for a third event state (down, press, up) would create some pretty odd conditions. (Is it down and still pressed? [Giant while loop while pressed]. Now it's up!]</description>
		<content:encoded><![CDATA[<p>I agree on FireBug! I used &#8220;console.log()&#8221; to log the events firing in my test. I didn&#8217;t know about &#8220;Log Events&#8221; though; that&#8217;s definitely sweet!</p>
<p>onkeydown and onkeypress have now been rendered functionally equivalent in all major browsers and will fire at the same time; they didn&#8217;t used to be, and I agree that they shouldn&#8217;t be, too. </p>
<p>However, I&#8217;m not really sure what the semantic difference between a keydown and a keypress would wind up being, and coding for a third event state (down, press, up) would create some pretty odd conditions. (Is it down and still pressed? [Giant while loop while pressed]. Now it&#8217;s up!]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Irish</title>
		<link>http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/#comment-6381</link>
		<dc:creator>Paul Irish</dc:creator>
		<pubDate>Mon, 02 Jul 2007 03:05:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/#comment-6381</guid>
		<description>Definitely. I tried this out just now using firebug (so much functionality in there!)
Inspect an element like a text input. Then when you're looking at the element in the HTML view, right-click and hit Log Events. Switch over to Console. Then click into the box and hold down a key.
I didnt expect to see both keydown and keypress firing together (shouldn't keydown fire once to match keyup? silly standards..), but they were!
Very interesting though.</description>
		<content:encoded><![CDATA[<p>Definitely. I tried this out just now using firebug (so much functionality in there!)<br />
Inspect an element like a text input. Then when you&#8217;re looking at the element in the HTML view, right-click and hit Log Events. Switch over to Console. Then click into the box and hold down a key.<br />
I didnt expect to see both keydown and keypress firing together (shouldn&#8217;t keydown fire once to match keyup? silly standards..), but they were!<br />
Very interesting though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ajm</title>
		<link>http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/#comment-6273</link>
		<dc:creator>ajm</dc:creator>
		<pubDate>Fri, 29 Jun 2007 11:55:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/#comment-6273</guid>
		<description>I agree that these are a really rough estimate and are totally variable. (And, my testing methodology was by no means the best :-) ).

In some testing on other machines, I wound up with something like 18 per second, which is still pretty close to the 16 on my original test run. My home machine has the repeat rate cranked all the way up to the max and fires 18 per second, so perhaps that's the upper boundary?

A scan of the YUI docs doesn't turn up anything on Event "threading" like this, and my experience with YUI leads me to believe that they don't "thread" events like this. I don't think Dojo does either. (Correct me if I'm wrong though).

In the end, firing off 16-18 Events a second in roll-you-own code is definitely something to keep in mind.</description>
		<content:encoded><![CDATA[<p>I agree that these are a really rough estimate and are totally variable. (And, my testing methodology was by no means the best <img src='http://blog.amodernfable.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).</p>
<p>In some testing on other machines, I wound up with something like 18 per second, which is still pretty close to the 16 on my original test run. My home machine has the repeat rate cranked all the way up to the max and fires 18 per second, so perhaps that&#8217;s the upper boundary?</p>
<p>A scan of the YUI docs doesn&#8217;t turn up anything on Event &#8220;threading&#8221; like this, and my experience with YUI leads me to believe that they don&#8217;t &#8220;thread&#8221; events like this. I don&#8217;t think Dojo does either. (Correct me if I&#8217;m wrong though).</p>
<p>In the end, firing off 16-18 Events a second in roll-you-own code is definitely something to keep in mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Irish</title>
		<link>http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/#comment-6268</link>
		<dc:creator>Paul Irish</dc:creator>
		<pubDate>Fri, 29 Jun 2007 03:55:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.amodernfable.com/2007/06/28/onkeypress-and-onkeydown-firing-rate/#comment-6268</guid>
		<description>In windows, you can manually set the repeat rate for holding down the key. I don't know if the browser (and if javascript) obey that, but I think the firing rate may be more variable than this.
And while I haven't checked, I bet the event handlers inside something like prototype or jquery implement something like the latter solution.</description>
		<content:encoded><![CDATA[<p>In windows, you can manually set the repeat rate for holding down the key. I don&#8217;t know if the browser (and if javascript) obey that, but I think the firing rate may be more variable than this.<br />
And while I haven&#8217;t checked, I bet the event handlers inside something like prototype or jquery implement something like the latter solution.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
