<?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>biotext.org.uk &#187; keyboard</title>
	<atom:link href="http://biotext.org.uk/tag/keyboard/feed/" rel="self" type="application/rss+xml" />
	<link>http://biotext.org.uk</link>
	<description>Not a typewriter</description>
	<lastBuildDate>Mon, 06 Sep 2010 12:44:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MacBook keyboard hacks for # (hash/pound/numbersign)</title>
		<link>http://biotext.org.uk/macbook-keyboard-hacks-for-hash-pound-numbersign/</link>
		<comments>http://biotext.org.uk/macbook-keyboard-hacks-for-hash-pound-numbersign/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 14:32:09 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=412</guid>
		<description><![CDATA[One of the few annoying things about my oldish MacBook Pro is its keyboard, for example a few unresponsive keys, but particularly the lack of a # key. It&#8217;s a UK keyboard, and has £ for shift-3, and # is hidden in alt-3 (not labelled).
This is fine in native desktop apps, but less fine in [...]]]></description>
			<content:encoded><![CDATA[<p>One of the few annoying things about my oldish MacBook Pro is its keyboard, for example a few unresponsive keys, but particularly the lack of a # key. It&#8217;s a UK keyboard, and has £ for shift-3, and # is hidden in alt-3 (not labelled).</p>
<p>This is fine in native desktop apps, but less fine in some text-mode programs (e.g. vim), when for some reason this often produces a superscript <sup>3</sup> instead.</p>
<p>So I&#8217;ve set up a custom keyboard mapping in iTerm to map F3 to #, which works nicely. <strong>However!</strong></p>
<p>If I&#8217;m SSHed in to a remote Linux machine (or even my local Ubuntu VirtualBox) neither of these keys work in X apps. But, xmodmap (via the config file ~/.Xmodmap) can help. For some reason, Macs all have a dedicated key for these characters &#8212; § and ± &#8212; which <em>no-one</em> ever uses. But with this line in ~/.Xmodmap we can remap it to produce #:</p>
<p>keycode 18=numbersign</p>
<p><strong>UPDATE:</strong> I&#8217;ve found a better way which works pretty much globally&#8230;</p>
<p>Using <a href="http://scripts.sil.org/Ukelele">Ukelele</a> you can copy the British keyboard layout and then remap keys to your heart&#8217;s content. I&#8217;ve moved the § character to the alt-§ key combination, in case I ever need it, and moved the # character to the raw § key. This seems to be respected <em>almost</em> everywhere so I don&#8217;t need to mess around with alt-3 or F3 any more. Joy. It also works over <a href="http://www.jinx.de/JollysFastVNC.html">JollysFastVNC</a> to a remote RealVNC server, which none of the other methods did.</p>
<p>Unfortunately, things still aren&#8217;t perfect. If I actually open a VirtualBox console session into GNOME on the local Ubuntu VM, the pointless § and ± key actually produces &lt; and &gt; so neither of these tricks work. In fact, I can&#8217;t get anything to generate a # even though I have the MacBook Pro Intl keyboard layout selected in GNOME. Any ideas?</p>
<p><strong>UPDATE 2:</strong> YES!! I&#8217;ve finally cracked it for VirtualBox. With the help of the xkeycaps command, I discovered that X the keycodes coming into Ubuntu weren&#8217;t what I thought they were &#8212; somewhere the Mac-ness of the keyboard layout was getting lost. It turned out that the § key was generating keycode 94 instead. So I set up this in .Xmodmap on the Ubuntu VM:</p>
<p>keycode 94=numbersign</p>
<p>Now it works in VirtualBox too. Leave gifts of thanks below <img src='http://biotext.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/macbook-keyboard-hacks-for-hash-pound-numbersign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
