<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SwellJS - another big fish in the sea &#187; Key combination</title>
	<atom:link href="http://blog.justswell.org/tag/key-combination/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.justswell.org</link>
	<description>well-minded javascript library</description>
	<lastBuildDate>Fri, 20 Aug 2010 20:48:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Swell makes javascript hot key event listeners a breeze&#8230;</title>
		<link>http://blog.justswell.org/swell-makes-hot-key-listeners-just-a-breeze/</link>
		<comments>http://blog.justswell.org/swell-makes-hot-key-listeners-just-a-breeze/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 08:26:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Swell]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[event listener]]></category>
		<category><![CDATA[Hot keys]]></category>
		<category><![CDATA[Key combination]]></category>
		<category><![CDATA[keyboard listener]]></category>

		<guid isPermaLink="false">http://blog.justswell.org/?p=14</guid>
		<description><![CDATA[These days the trend is to have a seamless desktop experience in your browser, that means pushing the boundaries of the web applications by trying to mimic the natural behavior of desktop hosted solutions. One of the must-have is undoubtedly a robust and easy-to-use event toolkit. That was one of the heaviest task and probably, [...]]]></description>
			<content:encoded><![CDATA[<p>These days the trend is to have a seamless desktop experience in your browser,  that means pushing the boundaries of the web applications by trying to mimic the natural behavior of desktop hosted solutions. One of the must-have is undoubtedly a robust and easy-to-use event toolkit. That was one of the heaviest task and probably, to date, one of the features we are most proud of.</p>
<p>We&#8217;ll try to make a bunch of articles on how to use the Event toolkit. Today we&#8217;ll talk about hot-keys, a hot-key is a key combination that you can use to trigger an action in your web-application, for example you are building a WYSIWYG editor and want to capture combination like Ctrl + B to turn the text in bold.</p>
<p>Here&#8217;s how you would create this keyboard event listener with Swell.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Swell.<span style="color: #660066;">Core</span>.<span style="color: #660066;">Event</span>.<span style="color: #660066;">addKeyListener</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> <span style="color: #3366CC;">'ctrl+b'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> keys<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">modifiers</span>.<span style="color: #660066;">ctrl</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>keys.<span style="color: #660066;">contains</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'b'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            Swell.<span style="color: #660066;">Lib</span>.<span style="color: #660066;">Selection</span>.<span style="color: #660066;">getCurrent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">wrap</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;strong&gt;$1&lt;/strong&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.justswell.org/swell-makes-hot-key-listeners-just-a-breeze/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

