<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Implementing higher-order clicks</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx</link><description>Triple-clicks and more.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>  Clairvoyant Interaction | Chui&amp;#8217;s counterpoint</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#8892220</link><pubDate>Sun, 24 Aug 2008 19:41:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8892220</guid><dc:creator>  Clairvoyant Interaction | Chui&amp;#8217;s counterpoint</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.redmountainsw.com/wordpress/archives/clairvoyant-interaction"&gt;http://www.redmountainsw.com/wordpress/archives/clairvoyant-interaction&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8892220" width="1" height="1"&gt;</description></item><item><title>Using modular arithmetic to avoid timing overflow problems</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#423408</link><pubDate>Tue, 31 May 2005 16:03:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:423408</guid><dc:creator>The Old New Thing</dc:creator><description>Avoiding timing overflows is easier than you think.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=423408" width="1" height="1"&gt;</description></item><item><title>re: Implementing higher-order clicks</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#256074</link><pubDate>Thu, 11 Nov 2004 23:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:256074</guid><dc:creator>Joshua Schaeffer</dc:creator><description>Merle, triple clicks in Word are one of the biggest time savers for me. Sometimes I'm in this utmost lazy chair position where even using right-click is a tiresome expense of a few seconds. Although I personally wouldn't mind a &amp;quot;click chart&amp;quot; like so:&lt;br&gt;&lt;br&gt;1 - (normal)&lt;br&gt;2 - word&lt;br&gt;3 - sentence&lt;br&gt;4 - paragraph&lt;br&gt;5 - everything&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=256074" width="1" height="1"&gt;</description></item><item><title>re: Implementing higher-order clicks</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#244553</link><pubDate>Tue, 19 Oct 2004 15:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:244553</guid><dc:creator>Raymond Chen</dc:creator><description>You can think of modulo arithmetic as points around a circle. Subtraction gives you the distance along the circumference, which doesn't care where your zero marker is.&lt;br&gt;&lt;br&gt;Another way of looking at subtraction is to view it as a translation of the circle, which is isometric (distance-preserving).&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=244553" width="1" height="1"&gt;</description></item><item><title>re: Implementing higher-order clicks</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#244414</link><pubDate>Tue, 19 Oct 2004 09:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:244414</guid><dc:creator>krisztian pinter</dc:creator><description>thanks, muro!&lt;br&gt;&lt;br&gt;in my mind, result of substraction was the same as the distance. in a &amp;quot;modulo world&amp;quot;, it is not that easy.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=244414" width="1" height="1"&gt;</description></item><item><title>re: Implementing higher-order clicks</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#244400</link><pubDate>Tue, 19 Oct 2004 09:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:244400</guid><dc:creator>muro</dc:creator><description>Overlooked in 32 bit part:&lt;br&gt;GetDoubleClickTime() = 10: would mean, the first 32bit example is also single click (as time difference is 15), but I hope you get the idea.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=244400" width="1" height="1"&gt;</description></item><item><title>re: Implementing higher-order clicks</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#244399</link><pubDate>Tue, 19 Oct 2004 09:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:244399</guid><dc:creator>muro</dc:creator><description>To clarify: consider, the difference calculation is correct:&lt;br&gt;tmClick - g_tmLastClick really calculates the time difference between the clicks correctly for our purpose, even when an overflow happens.&lt;br&gt;&lt;br&gt;First, lets show the overflow calculations with 8bits. GetDoubleClickTime() = 0x10:&lt;br&gt;0x01 - 0xff = 0x01 + ~(0xff) = 0x01 + (0x100 - 0xff) = 0x01 + 0x01 = 0x02 -&amp;gt; double click&lt;br&gt;0x21 - 0xff = 0x21 + ~(0xff) = 0x21 + (0x100 - 0xff) = 0x21 + 0x01 = 0x22 -&amp;gt; single click&lt;br&gt;&lt;br&gt;&lt;br&gt;Then the same for 32bit:&lt;br&gt;GetDoubleClickTime() = 10:&lt;br&gt;g_tmLastClick == 4bil = e.g.: 2^32 - 10&lt;br&gt;tmClick == 5:&lt;br&gt;5 - 4bil = 5 + ~(4bil) = 5 + (2^32 - 10) = 5 + 10 = 15 -&amp;gt; double click&lt;br&gt;&lt;br&gt;&lt;br&gt;tmClick == 60000 (click one minute later):&lt;br&gt;60000 - 4bil = 60000 + ~(4bil) = 60000 + (2^32 - 10) = 60000 + 10 = 60010 -&amp;gt; single click&lt;br&gt;&lt;br&gt;Sometimes it helps to think in lower precision. Makes all the scary big numbers go away :-). And off course - remember that subtraction is addition of complement. Makes it even less scary.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=244399" width="1" height="1"&gt;</description></item><item><title>re: Implementing higher-order clicks</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#244369</link><pubDate>Tue, 19 Oct 2004 07:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:244369</guid><dc:creator>krisztian pinter</dc:creator><description>i still not get that DoubleClickTime trick&lt;br&gt;&lt;br&gt;say &lt;br&gt;g_tmLastClick == ~4bil&lt;br&gt;tmClick == 10&lt;br&gt;&lt;br&gt;now 10 - ~4bil is a large number because of the overflow. it will treated as a double. OK.&lt;br&gt;&lt;br&gt;but&lt;br&gt;&lt;br&gt;g_tmLastClick == ~4bil&lt;br&gt;tmClick == 60000 (click one minute later)&lt;br&gt;&lt;br&gt;60000 - ~4bil is still a large number, so it will also be treated as double, however it is clearly a single.&lt;br&gt;&lt;br&gt;can someone explain this to me?&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=244369" width="1" height="1"&gt;</description></item><item><title>re: Implementing higher-order clicks</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#244366</link><pubDate>Tue, 19 Oct 2004 07:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:244366</guid><dc:creator>Cyrus Najmabadi</dc:creator><description>Ugh, you had to write the code for this now after i spent a good half day getting this working right in some code i was writing.  What's worse is that you're the one who told me how to do it, but you weren't willing to take the time to write this up :-P&lt;br&gt;&lt;br&gt;Oh, and to those of you who are interested this was to add a feature in C# where as you click more and more we start selecting more and more of the C# code you've written based on the parse tree.&lt;br&gt;&lt;br&gt;So we'll start by selecting the expression, then the statement, the then method, then the class, namespace, etc.  Basically each successive click selects one higher level in the parse tree.&lt;br&gt;&lt;br&gt;it's a feature you grow to love :-)&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=244366" width="1" height="1"&gt;</description></item><item><title>re: Implementing higher-order clicks</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/10/18/243925.aspx#244348</link><pubDate>Tue, 19 Oct 2004 05:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:244348</guid><dc:creator>Raymond Chen</dc:creator><description>Oh, you're right. I forgot what I wrote. (I wrote it so long ago.)&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=244348" width="1" height="1"&gt;</description></item></channel></rss>