<?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: Handling Keyboard Shortcuts in JavaScript</title>
	<atom:link href="http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 18 Mar 2010 02:38:40 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: pass4sure</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-279437</link>
		<dc:creator>pass4sure</dc:creator>
		<pubDate>Mon, 01 Mar 2010 02:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-279437</guid>
		<description>Pass4sure is your best choice for any IT certifications because of its high quality. It provides full-scale study materials, including the questions, answers and pinpoint explanations supplied by a group of IT experts. Its considerate &amp; warmhearted service and complete safeguard measures remove all your doubts about the products quality.The Most Popular exams List :&lt;a href=&quot;http://www.passforsure.co.uk/JK0-016.html&quot; rel=&quot;nofollow&quot;&gt;JK0-016&lt;/a&gt;&lt;a href=&quot;http://www.passforsure.co.uk/1Y0-A05.html&quot; rel=&quot;nofollow&quot;&gt;1Y0-A05&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/642-812.html&quot; rel=&quot;nofollow&quot;&gt;642-812&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/HP0-S21.html&quot; rel=&quot;nofollow&quot;&gt;HP0-S21&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/642-533.html&quot; rel=&quot;nofollow&quot;&gt;642-533&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/646-985.html&quot; rel=&quot;nofollow&quot;&gt;646-985&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/310-202.html&quot; rel=&quot;nofollow&quot;&gt;310-202&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/640-816.html&quot; rel=&quot;nofollow&quot;&gt;640-816&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/350-030-LAB.html&quot; rel=&quot;nofollow&quot;&gt;350-030-LAB&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/1Z0-051.html&quot; rel=&quot;nofollow&quot;&gt;1Z0-051&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/650-175.html&quot; rel=&quot;nofollow&quot;&gt;650-175&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/132-S-911.3.html&quot; rel=&quot;nofollow&quot;&gt;132-S-911.3&lt;/a&gt;&lt;a href=&quot;http://www.passforsure.co.uk/640-816.html&quot; rel=&quot;nofollow&quot;&gt;640-816&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/642-436.html&quot; rel=&quot;nofollow&quot;&gt;642-436&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/BR0-001.html&quot; rel=&quot;nofollow&quot;&gt;BR0-001&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/VCP-310.html&quot; rel=&quot;nofollow&quot;&gt;VCP-310&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/312-50.html&quot; rel=&quot;nofollow&quot;&gt;312-50&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/1Z0-042.html&quot; rel=&quot;nofollow&quot;&gt;1Z0-042&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/JN0-532.html&quot; rel=&quot;nofollow&quot;&gt;JN0-532&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/XK0-002.html&quot; rel=&quot;nofollow&quot;&gt;XK0-002&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/642-446.html&quot; rel=&quot;nofollow&quot;&gt;642-446&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/NS0-163.html&quot; rel=&quot;nofollow&quot;&gt;NS0-163&lt;/a&gt;&#160;&lt;a href=&quot;http://www.passforsure.co.uk/640-802.html&quot; rel=&quot;nofollow&quot;&gt;640-802&lt;/a&gt;&#160;Click &lt;a href=&quot;http://www.passforsure.co.uk/&quot; rel=&quot;nofollow&quot;&gt;Passforsure&lt;/a&gt; to get more information!</description>
		<content:encoded><![CDATA[<p>Pass4sure is your best choice for any IT certifications because of its high quality. It provides full-scale study materials, including the questions, answers and pinpoint explanations supplied by a group of IT experts. Its considerate &amp; warmhearted service and complete safeguard measures remove all your doubts about the products quality.The Most Popular exams List :<a href="http://www.passforsure.co.uk/JK0-016.html" rel="nofollow">JK0-016</a><a href="http://www.passforsure.co.uk/1Y0-A05.html" rel="nofollow">1Y0-A05</a>&nbsp;<a href="http://www.passforsure.co.uk/642-812.html" rel="nofollow">642-812</a>&nbsp;<a href="http://www.passforsure.co.uk/HP0-S21.html" rel="nofollow">HP0-S21</a>&nbsp;<a href="http://www.passforsure.co.uk/642-533.html" rel="nofollow">642-533</a>&nbsp;<a href="http://www.passforsure.co.uk/646-985.html" rel="nofollow">646-985</a>&nbsp;<a href="http://www.passforsure.co.uk/310-202.html" rel="nofollow">310-202</a>&nbsp;<a href="http://www.passforsure.co.uk/640-816.html" rel="nofollow">640-816</a>&nbsp;<a href="http://www.passforsure.co.uk/350-030-LAB.html" rel="nofollow">350-030-LAB</a>&nbsp;<a href="http://www.passforsure.co.uk/1Z0-051.html" rel="nofollow">1Z0-051</a>&nbsp;<a href="http://www.passforsure.co.uk/650-175.html" rel="nofollow">650-175</a>&nbsp;<a href="http://www.passforsure.co.uk/132-S-911.3.html" rel="nofollow">132-S-911.3</a><a href="http://www.passforsure.co.uk/640-816.html" rel="nofollow">640-816</a>&nbsp;<a href="http://www.passforsure.co.uk/642-436.html" rel="nofollow">642-436</a>&nbsp;<a href="http://www.passforsure.co.uk/BR0-001.html" rel="nofollow">BR0-001</a>&nbsp;<a href="http://www.passforsure.co.uk/VCP-310.html" rel="nofollow">VCP-310</a>&nbsp;<a href="http://www.passforsure.co.uk/312-50.html" rel="nofollow">312-50</a>&nbsp;<a href="http://www.passforsure.co.uk/1Z0-042.html" rel="nofollow">1Z0-042</a>&nbsp;<a href="http://www.passforsure.co.uk/JN0-532.html" rel="nofollow">JN0-532</a>&nbsp;<a href="http://www.passforsure.co.uk/XK0-002.html" rel="nofollow">XK0-002</a>&nbsp;<a href="http://www.passforsure.co.uk/642-446.html" rel="nofollow">642-446</a>&nbsp;<a href="http://www.passforsure.co.uk/NS0-163.html" rel="nofollow">NS0-163</a>&nbsp;<a href="http://www.passforsure.co.uk/640-802.html" rel="nofollow">640-802</a>&nbsp;Click <a href="http://www.passforsure.co.uk/" rel="nofollow">Passforsure</a> to get more information!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fallen</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-259900</link>
		<dc:creator>Fallen</dc:creator>
		<pubDate>Wed, 12 Dec 2007 09:46:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-259900</guid>
		<description>I am trying to figure all out and it seems like a very powerful  thing. I was struggling with shortcuts for some time now, but this one made my life easier...
just my 2c</description>
		<content:encoded><![CDATA[<p>I am trying to figure all out and it seems like a very powerful  thing. I was struggling with shortcuts for some time now, but this one made my life easier&#8230;<br />
just my 2c</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jab</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-254508</link>
		<dc:creator>jab</dc:creator>
		<pubDate>Mon, 27 Aug 2007 09:11:31 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-254508</guid>
		<description>One of my favorite sites for keyboard shortcuts is keyxl.com. They must have hundreds of programs listed.

http://www.keyxl.com</description>
		<content:encoded><![CDATA[<p>One of my favorite sites for keyboard shortcuts is keyxl.com. They must have hundreds of programs listed.</p>
<p><a href="http://www.keyxl.com" rel="nofollow">http://www.keyxl.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morris</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-249730</link>
		<dc:creator>Morris</dc:creator>
		<pubDate>Tue, 24 Apr 2007 06:03:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-249730</guid>
		<description>If using Dojo, you can do something similar:

&lt;code&gt;
	getKeyName: function(event) {
		var keyName = dojo.event.browser.revKeys[event.keyCode];
		if (keyName) {
			keyName = keyName.substring(4); // Drop KEY_ prefix
		}
		if (keyName &amp;&amp; keyName != &#039;SHIFT&#039; &amp;&amp; keyName != &#039;ALT&#039; &amp;&amp; keyName != &#039;CTRL&#039;) {
			if (event.shiftKey) {
				keyName = &#039;SHIFT_&#039; + keyName;
			}
			if (event.altKey) {
				keyName = &#039;ALT_&#039; + keyName;
			}
			if (event.ctrlKey) {
				keyName = &#039;CTRL_&#039; + keyName;
			}
		}
		return keyName;
	},

	onKeyDown: function(event) {
		var keyFn = this.keyActions[this.getKeyName(event)];
		if (keyFn) {
			if (!keyFn.call(this, event)) {
				event.preventDefault();
			}
		}
	},

	keyActions: {
		UP_ARROW: function() {
				this.selectMoveBy(-1,0);
			},
		DOWN_ARROW: function() {
				this.selectMoveBy(1,0);
			},
		LEFT_ARROW: function() {
				this.selectMoveBy(0,-1);
			},
		RIGHT_ARROW: function() {
				this.selectMoveBy(0,1);
			},
		SHIFT_UP_ARROW: function() {
				this.selectMoreBlock(-1,0);
			},
		SHIFT_DOWN_ARROW: function() {
				this.selectMoreBlock(1,0);
			},
		SHIFT_LEFT_ARROW: function() {
				this.selectMoreBlock(0,-1);
			},
		SHIFT_RIGHT_ARROW: function() {
				this.selectMoreBlock(0,1);
			},
		CTRL_HOME: function() {
				this.goHome();
			},
		CTRL_END: function() {
				this.goEnd();
			},
		HOME: function() {
				this.selectMoveBy(0,-10000);
			},
		END: function() {
				this.selectMoveBy(0,10000);
			},
		PAGE_UP: function() {
				this.movePage(-1);
			},
		PAGE_DOWN: function() {
				this.movePage(1);
			},
		ESCAPE: function() {
			if (this.columnResizing) {
				this.stopColumnResizing(-1); 
			} else {
				return true;
			}
		},
		TAB: function() {
				return true;
			},
		CTRL_TAB: function() {
				return true;
			},
		SHIFT_TAB: function() {
				return true;
			}
	}

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>If using Dojo, you can do something similar:</p>
<p><code><br />
	getKeyName: function(event) {<br />
		var keyName = dojo.event.browser.revKeys[event.keyCode];<br />
		if (keyName) {<br />
			keyName = keyName.substring(4); // Drop KEY_ prefix<br />
		}<br />
		if (keyName &amp;&amp; keyName != 'SHIFT' &amp;&amp; keyName != 'ALT' &amp;&amp; keyName != 'CTRL') {<br />
			if (event.shiftKey) {<br />
				keyName = 'SHIFT_' + keyName;<br />
			}<br />
			if (event.altKey) {<br />
				keyName = 'ALT_' + keyName;<br />
			}<br />
			if (event.ctrlKey) {<br />
				keyName = 'CTRL_' + keyName;<br />
			}<br />
		}<br />
		return keyName;<br />
	},</p>
<p>	onKeyDown: function(event) {<br />
		var keyFn = this.keyActions[this.getKeyName(event)];<br />
		if (keyFn) {<br />
			if (!keyFn.call(this, event)) {<br />
				event.preventDefault();<br />
			}<br />
		}<br />
	},</p>
<p>	keyActions: {<br />
		UP_ARROW: function() {<br />
				this.selectMoveBy(-1,0);<br />
			},<br />
		DOWN_ARROW: function() {<br />
				this.selectMoveBy(1,0);<br />
			},<br />
		LEFT_ARROW: function() {<br />
				this.selectMoveBy(0,-1);<br />
			},<br />
		RIGHT_ARROW: function() {<br />
				this.selectMoveBy(0,1);<br />
			},<br />
		SHIFT_UP_ARROW: function() {<br />
				this.selectMoreBlock(-1,0);<br />
			},<br />
		SHIFT_DOWN_ARROW: function() {<br />
				this.selectMoreBlock(1,0);<br />
			},<br />
		SHIFT_LEFT_ARROW: function() {<br />
				this.selectMoreBlock(0,-1);<br />
			},<br />
		SHIFT_RIGHT_ARROW: function() {<br />
				this.selectMoreBlock(0,1);<br />
			},<br />
		CTRL_HOME: function() {<br />
				this.goHome();<br />
			},<br />
		CTRL_END: function() {<br />
				this.goEnd();<br />
			},<br />
		HOME: function() {<br />
				this.selectMoveBy(0,-10000);<br />
			},<br />
		END: function() {<br />
				this.selectMoveBy(0,10000);<br />
			},<br />
		PAGE_UP: function() {<br />
				this.movePage(-1);<br />
			},<br />
		PAGE_DOWN: function() {<br />
				this.movePage(1);<br />
			},<br />
		ESCAPE: function() {<br />
			if (this.columnResizing) {<br />
				this.stopColumnResizing(-1);<br />
			} else {<br />
				return true;<br />
			}<br />
		},<br />
		TAB: function() {<br />
				return true;<br />
			},<br />
		CTRL_TAB: function() {<br />
				return true;<br />
			},<br />
		SHIFT_TAB: function() {<br />
				return true;<br />
			}<br />
	}</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-249613</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Thu, 19 Apr 2007 23:41:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-249613</guid>
		<description>It&#039;s a great library! But how do you remove the shortcut if you want to replace it with another or simply release the shortcut?</description>
		<content:encoded><![CDATA[<p>It&#8217;s a great library! But how do you remove the shortcut if you want to replace it with another or simply release the shortcut?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Liming Xu</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-249598</link>
		<dc:creator>Liming Xu</dc:creator>
		<pubDate>Thu, 19 Apr 2007 15:45:48 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-249598</guid>
		<description>pretty userful. I wonder if i can somehow combined it with my ajax libraries and let the users define their hot-keys...</description>
		<content:encoded><![CDATA[<p>pretty userful. I wonder if i can somehow combined it with my ajax libraries and let the users define their hot-keys&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gilles</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-249590</link>
		<dc:creator>Gilles</dc:creator>
		<pubDate>Thu, 19 Apr 2007 12:45:46 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-249590</guid>
		<description>I&#039;ve made a port to a jQuery plugin of this. I haven&#039;t added it to SVN yet, but i tested it against &quot;ctrl+s&quot; in firefox. The event didn&#039;t trigger the &quot;Save as&quot; function :)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve made a port to a jQuery plugin of this. I haven&#8217;t added it to SVN yet, but i tested it against &#8220;ctrl+s&#8221; in firefox. The event didn&#8217;t trigger the &#8220;Save as&#8221; function :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Wilkerson</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-249589</link>
		<dc:creator>Rob Wilkerson</dc:creator>
		<pubDate>Thu, 19 Apr 2007 12:19:48 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-249589</guid>
		<description>Looks great, but will be dependent on the user&#039;s environment, running applications and previously defined hotkeys.  On my system, one of his demo shortcuts (Shift+F1) displays the Google Desktop browser and doesn&#039;t activate the intended action.  

Still a great library if you can live with the potential for variation among user systems.  Hopefully keyboard shortcuts are merely a navigational *aid*.  :-)</description>
		<content:encoded><![CDATA[<p>Looks great, but will be dependent on the user&#8217;s environment, running applications and previously defined hotkeys.  On my system, one of his demo shortcuts (Shift+F1) displays the Google Desktop browser and doesn&#8217;t activate the intended action.  </p>
<p>Still a great library if you can live with the potential for variation among user systems.  Hopefully keyboard shortcuts are merely a navigational *aid*.  :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Leonard</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-249575</link>
		<dc:creator>Tim Leonard</dc:creator>
		<pubDate>Thu, 19 Apr 2007 07:49:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-249575</guid>
		<description>I&#039;m already using this in some projects.

Seems to work quite well... but obviously some key combos are a no-go in different browsers. :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m already using this in some projects.</p>
<p>Seems to work quite well&#8230; but obviously some key combos are a no-go in different browsers. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcel</title>
		<link>http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript/comment-page-1#comment-249574</link>
		<dc:creator>Marcel</dc:creator>
		<pubDate>Thu, 19 Apr 2007 07:28:27 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript#comment-249574</guid>
		<description>I wonder..

shortcut(&quot;Alt+F4&quot;, function() {
    return false;
});

To stop people from instantly closing my popups.. don&#039;t worry, they&#039;re actually informative popups in a custom built intranet. I guess it won&#039;t work ;-)</description>
		<content:encoded><![CDATA[<p>I wonder..</p>
<p>shortcut(&#8221;Alt+F4&#8243;, function() {<br />
    return false;<br />
});</p>
<p>To stop people from instantly closing my popups.. don&#8217;t worry, they&#8217;re actually informative popups in a custom built intranet. I guess it won&#8217;t work ;-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
