<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: shortcuts code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 29 Aug 2008 03:07:02 GMT</pubDate>
    <description>DZone Snippets: shortcuts code</description>
    <item>
      <title>Chickenfoot shortcut script</title>
      <link>http://snippets.dzone.com/posts/show/3722</link>
      <description>Here's a little script to get Chickenfoot to add some keyboard shortcuts to firefox.&lt;br /&gt;&lt;br /&gt;Add this to run as a trigger on window open and you'll be able to acquire focus on the current chickenfoot editor window by pressing 'alt-C' and to regain focus on the main tab (which is something I've often wanted to be able to do) with 'alt-D'&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;// attach keyboard shortcut (Alt-C)&lt;br /&gt;chromeWindow.addEventListener("keypress",&lt;br /&gt;   function(event) {&lt;br /&gt;     if (event.altKey &amp;&amp; event.charCode == 'c'.charCodeAt(0)) {&lt;br /&gt;       event.preventDefault();&lt;br /&gt;       var sidebar = Chickenfoot.getSidebarWindow(chromeWindow);&lt;br /&gt;       if (sidebar) {&lt;br /&gt;          sidebar.getSelectedBuffer().focus();&lt;br /&gt;       }&lt;br /&gt;     }&lt;br /&gt;    },&lt;br /&gt;    true);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// attach keyboard shortcut (Alt-D)&lt;br /&gt;chromeWindow.addEventListener("keypress",&lt;br /&gt;   function(event) {&lt;br /&gt;     if (event.altKey &amp;&amp; event.charCode == 'd'.charCodeAt(0)) {&lt;br /&gt;       event.preventDefault();&lt;br /&gt;	   tab.focus();&lt;br /&gt;       }&lt;br /&gt;    },&lt;br /&gt;    false);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 24 Mar 2007 17:24:50 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3722</guid>
      <author>DRMacIver (David R. MacIver)</author>
    </item>
  </channel>
</rss>
