<?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: capturing + (plus key) with keymaster.js</title>
	<atom:link href="http://www.paulferrett.com/2012/capturing-plus-key-with-keymaster-js/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paulferrett.com/2012/capturing-plus-key-with-keymaster-js/</link>
	<description>...coding in (mainly) PHP and MySQL</description>
	<lastBuildDate>Thu, 11 Apr 2013 14:23:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Mo</title>
		<link>http://www.paulferrett.com/2012/capturing-plus-key-with-keymaster-js/comment-page-1/#comment-1272</link>
		<dc:creator>Mo</dc:creator>
		<pubDate>Mon, 09 Jul 2012 08:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.paulferrett.com/?p=170#comment-1272</guid>
		<description><![CDATA[&quot;=&quot; and &quot;+&quot; don&#039;t always share the same keyCode for keydown events in JavaScript. I&#039;ve had similar issues in the past when handling keyboard events. Frustratingly, key codes can be different across different browsers and operating systems.

In Safari &amp; Chrome on Mac, = has code 187 and + has code 187.
In Firefox on Mac, = has code 61 and + has code 107.
In Firefox on Windows, = has code 107 and + has code 107.
In IE on Windows, = has code 187 and + has code 107.
In Chrome on Windows, = has code 187, + has code 187 and the numpad + has code 107.

To differentiate between codes that are the same for a keydown, I think you&#039;d have to look at the keypress charCodes for them as they will be different. But as you say, what you&#039;ve got is a trivial trade-off so it&#039;s probably not worth the effort!

I hadn&#039;t seen keymaster.js before - looks pretty neat! You could add more to its special mappings array to declare &quot;plus: 107&quot; and &quot;equals: 61&quot; then have key(&#039;=, shift+=, plus, shift+equals&#039;, ...) to be able to catch +&#039;s for IE and Firefox Mac.]]></description>
		<content:encoded><![CDATA[<p>&#8220;=&#8221; and &#8220;+&#8221; don&#8217;t always share the same keyCode for keydown events in JavaScript. I&#8217;ve had similar issues in the past when handling keyboard events. Frustratingly, key codes can be different across different browsers and operating systems.</p>
<p>In Safari &amp; Chrome on Mac, = has code 187 and + has code 187.<br />
In Firefox on Mac, = has code 61 and + has code 107.<br />
In Firefox on Windows, = has code 107 and + has code 107.<br />
In IE on Windows, = has code 187 and + has code 107.<br />
In Chrome on Windows, = has code 187, + has code 187 and the numpad + has code 107.</p>
<p>To differentiate between codes that are the same for a keydown, I think you&#8217;d have to look at the keypress charCodes for them as they will be different. But as you say, what you&#8217;ve got is a trivial trade-off so it&#8217;s probably not worth the effort!</p>
<p>I hadn&#8217;t seen keymaster.js before &#8211; looks pretty neat! You could add more to its special mappings array to declare &#8220;plus: 107&#8243; and &#8220;equals: 61&#8243; then have key(&#8216;=, shift+=, plus, shift+equals&#8217;, &#8230;) to be able to catch +&#8217;s for IE and Firefox Mac.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
