<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Micah Elliott &#187; hacks</title>
	<atom:link href="http://micahelliott.com/tag/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://micahelliott.com</link>
	<description>Stories from my Startup Journey</description>
	<lastBuildDate>Mon, 29 Nov 2010 07:46:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
<image>
  <link>http://micahelliott.com</link>
  <url>http://micahelliott.com/mde-gravatar7.png</url>
  <title>Micah Elliott</title>
</image>
	<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.6.3" -->
	<copyright>Copyright &#38;#xA9; Micah Elliott 2010 </copyright>
	<managingEditor>mde@micahelliott.com (Micah Elliott)</managingEditor>
	<webMaster>mde@micahelliott.com (Micah Elliott)</webMaster>
	<category>posts</category>
	<image>
		<url>http://micahelliott.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Micah Elliott &#187; hacks</title>
		<link>http://micahelliott.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Stories from my Startup Journey</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &amp; Culture" />
	<itunes:author>Micah Elliott</itunes:author>
	<itunes:owner>
		<itunes:name>Micah Elliott</itunes:name>
		<itunes:email>mde@micahelliott.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://micahelliott.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Make a PC Keyboard UNIX-Friendly</title>
		<link>http://micahelliott.com/2009/04/make-a-pc-keyboard-unix-friendly/</link>
		<comments>http://micahelliott.com/2009/04/make-a-pc-keyboard-unix-friendly/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 18:47:43 +0000</pubDate>
		<dc:creator>Micah</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Living]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[health]]></category>
		<category><![CDATA[keyboard]]></category>

		<guid isPermaLink="false">http://micahelliott.com/?p=362</guid>
		<description><![CDATA[How many years have you been making the tedious stretch for Ctrl and Esc keys?  Maybe you&#8217;ve gone so far as choosing workflows that don&#8217;t require them much, maybe without even realizing it.  That would be sad.  You just can&#8217;t use vim or emacs (or even web browsers) without them.*  I stopped the stretching a [...]]]></description>
			<content:encoded><![CDATA[<p>How many years have you been making the tedious stretch for <code>Ctrl</code> and <code>Esc</code> keys?  Maybe you&#8217;ve gone so far as choosing workflows that don&#8217;t require them much, maybe without even realizing it.  That would be sad.  You just can&#8217;t use vim or emacs (or even web browsers) without them.*  I stopped the stretching a long time ago.  If you haven&#8217;t fixed this yet, you&#8217;re either crippling yourself, or being sub-optimally productive.  There are various ways to this and eliminate the stretching &#8212; I&#8217;ll touch on a couple so you can relieve your aching left wrist.<span id="more-362"></span></p>
<h2>Easiest way</h2>
<p><a href="http://us.st12.yimg.com/us.st.yimg.com/I/pfuca-store_2030_8561"><img class="alignleft" title="Happy Hacking Keyboard Lite 2" src="http://us.st12.yimg.com/us.st.yimg.com/I/pfuca-store_2030_8561" alt="" width="180" height="104" /></a>Almost a decade ago the <a href="http://pfuca-store.stores.yahoo.net/haphackeylit1.html">Happy Hacking keyboard</a> came out.  This was a brilliant product that I can&#8217;t believe hasn&#8217;t altogether replaced the PC layout and monster keyboard footprint.  I&#8217;ve had a few through the years, and I highly recommend them.  They have been at the $70 mark all along though, so I&#8217;ve decided to stop buying them, when commodity keyboards are a dime a dozen, even the small footprinted ones.  I&#8217;ve also had the legendary OMNIKEY (and maintain it as a keepsake), which is hands down the best keyboard ever made (clickety-click-clack).  But they&#8217;re even pre-PS/2, so probably impossible to get working with USB (let me know if you&#8217;ve done it!).  So that&#8217;s the first and <strong>simplest solution if you&#8217;ve got the budget: spend the money to get a great UNIX keyboard.</strong></p>
<p><strong><img class="aligncenter" title="OmniKey Ultra" src="http://www.amiga-hardware.com/download_photos/omnikeyultra_big.jpg" alt="" width="780" height="289" /><br />
</strong></p>
<h2>Harder, cheaper way (still easy enough)</h2>
<p>But you probably work at various machines, and everyone has a budget.  And sometimes we have to use that silly laptop keyboard.  So now you&#8217;re looking at <strong>a keyboard reconfig</strong>.  If you just want to make <code>CapsLock</code> go away (not a bad idea) and put <code>Ctrl</code> where it&#8217;s supposed to be (left of &#8216;<code>A</code>&#8216;), you can use GNOME to swap them.  Something like: <em>System -&gt; Preferences -&gt; Keyboard -&gt; Layouts -&gt; Other Options -&gt; Ctrl Key Position -&gt; Make CapsLock an additional Ctrl</em>.  There&#8217;s also some swapping options, but overall the options there are pretty rigid and don&#8217;t get you all the way there.  So don&#8217;t bother with this approach, unless you only want to fix the <code>Ctrl</code> key.</p>
<p>What you really need is <strong>xkeycaps</strong>.  You can install it in a Debian-based system with <code>apt-get install xkeycaps</code>.  Other distros should also make it easy.  It&#8217;s not the most intuitive tool to use if you haven&#8217;t played with it before (that&#8217;s why I&#8217;m writing this), so I&#8217;ll walk you through what I did with it.  BTW, it&#8217;s an ancient tool, from the legendary hacker <a href="http://www.jwz.org/">Jamie Zawinski</a>.</p>
<p>Some keyboard layouts vary slightly from <a href="http://en.wikipedia.org/wiki/IBM_PC_keyboard">the 104-key standard</a>, but I believe you can get any cheapo or absurd laptop layout to do the right thing with a little experimentation.  We&#8217;re going to be reassigning some keys.  It&#8217;s crucial that <code>Esc</code> is in a friendly spot &#8212; that probably means just left of your 1 key.  Even on a small keyboard with an <code>Esc</code> just one close row up, it&#8217;s still too far; you&#8217;ve gotta try putting it in the optimal spot.  But then you&#8217;ll be losing <code>`~</code> (or something)!  What a dilemma!  You can&#8217;t code without those.  Some will disagree with me here, but I have found the <code>RightAlt</code> key to be a great, easily right-thumb-accessible, unused key, so that&#8217;s what I now use for <code>`~</code>.  <code>RightAlt</code> is a sad loss if you&#8217;ve got a crappy mouse (since <code>RightAlt-LeftArrow</code> have been the canonical browser back-button), but that may be the subject of another article.  Just get a 5-button or tilt-wheel mouse; recent Ubuntus do the right thing with the extra buttons, in my experience.  So we&#8217;ll proceed here to use <code>RightAlt</code> as the <code>`~</code> replacement.  And we&#8217;ll be throwing away the original inaccessible <code>Esc</code>.  That top Function key row is off limits for touch-typists.</p>
<p>You can scramble a bunch of keys around as your see fit for your MO.  Here&#8217;s the process I used (as close as I can recall) for the <code>Ctrl</code>, <code>Esc</code>, <code>`~</code> reassignments I&#8217;ve been describing:</p>
<ul>
<li>Fire it up from a terminal: <code>xkeycaps</code></li>
<li>Just say &#8216;ok&#8217; on the first screen which should default to the right &#8216;PC&#8217; layout.</li>
<li>Hover over the <code>Esc</code> key and notice the <em>KeySym</em> at the top, indicating you&#8217;ve looking at <code>Esc</code>.  If you screw anything up, this is the place to see it.</li>
<li>Move away and physically press <code>Esc</code> and watch it light up on the screen.  Now you can verify any key&#8217;s position, which you want to do for any changing keys.</li>
<li>Make sure all the keys we care about are mapping to the right location.  I found that <code>RightAlt</code> on my wacky keyboard was actually mapping to my number pad&#8217;s <code>Enter</code>.  So figure out what your <code>RightAlt</code> is by pressing it.  That&#8217;s what we&#8217;ll reassign.</li>
<li>Make the first reassignment.  Right-click-hold on <code>`~</code> and select <em>Duplicate key</em>.  Then click on <code>RightAlt</code> (or its equivalent).  Now you&#8217;ve got another <code>`~</code> key! (and you can probably figure out the rest).</li>
<li>Now we can reassign the original <code>`~</code> to be an <code>Esc</code>.</li>
<li>Do the same <em>Duplicate key</em> trick to make the original <code>Esc</code> duplicated over <code>`~</code>.</li>
<li>Finally, do that process one more time assigning the original <code>Ctrl</code> (crazy bottom-left postion) over the top of <code>CapsLock</code>.  Added bonus: no more <code>CapsLock</code> key (remedy that if you want).</li>
<li>Write out the new layout with the <em>Write Output</em> button (just the <em>Changed Keys</em> is enough).</li>
<li>Now you&#8217;ve got a new <code>~/.xmodmap-<em>machinename</em></code> file.  I believe it&#8217;s already been activated at this point, or at least <code>xkeycaps</code> has done some magic.</li>
<li>You&#8217;re done.  You might find that some things are not working at this point.  You can always restart <code>xkeycaps</code> and restore to defaults.  But you&#8217;ve likely got things right, and just need to log out of X and log back in.  My arrow keys broke when I did this before restarting X.</li>
<li>Every time you start up X you&#8217;ll need to run <code>xmodmap ~/.xmodmap-<em>machinename</em></code>.  But Ubuntu (or something) actually automatically detected my new <code>.xmodmap</code> and prompted me to ask if I wanted to use it.  That was friendly!</li>
<li>Use some white-out or tape to relabel your new keys. (optional)</li>
</ul>
<p>Whew!  That was quite a few steps.  Fortunately, it&#8217;s just a one time setup, and subsequent uses of <code>xmodmap</code> at login are trivial (put it  in your <code>.bash_profile</code> or equivalent if not prompted; use <code>$(uname -n)</code> to make it flexible for a shared profile).  I hope you&#8217;ve got it working now.  You can leave a comment if you&#8217;re having any trouble with the steps and maybe I (or someone) will be able to figure it out.  Breathe a sigh of relief as you re-train your fingers to stop stretching.</p>
<p>I can no longer type without the hack described here.  You can probably alter it for any machine you&#8217;re on and any of your own different preferences.  I&#8217;m also considering making <code>Ctrl-J</code> a permanent duplicate for <code>Enter</code>.</p>
<p>I should also add a rant for why this article and tools need to exist: Shame on IBM and Microsoft and all the others involved for being such layout idiots and costing the world so much in ongoing <a href="http://en.wikipedia.org/wiki/Carpal_tunnel_syndrome">CTS</a> healthcare costs.  Especially when the optimal layout was already well-known and widely used.  Remind you of anything (backslash path separator, another ergonomic impropriety; plus countless others)?  It&#8217;s really interesting to just stare down at the PC location of Ctrl and Esc, two essential keys probably both in the top 5.  They couldn&#8217;t possible have been put in less convenient places.  Well, maybe they were just taking the QWERTY model of slowing down typists to the next level.  I&#8217;m surprised they didn&#8217;t think to move <code>Shift</code> up to <code>F5</code> and <code>Enter</code> over to <code>ScrollLock</code>.</p>
<p>Be sure to thank Jamie for saving your wrist and adding years of screen time to your life.</p>
<p><em><span style="color: #999999;">* Furthermore, I make the typical assumption you&#8217;re using some *NIX variant.  Why else would you be here?  But if you&#8217;re using Windows or a Mac there are some other tools floating around that will help you customize your keyboard layout; I&#8217;m sure they&#8217;ll be different from xkeycaps.  Whether hacker or not, anyone can benefit by making these changes.</span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://micahelliott.com/2009/04/make-a-pc-keyboard-unix-friendly/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

