<?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>delx &#187; apple</title>
	<atom:link href="http://delx.net.au/blog/tag/apple/feed/" rel="self" type="application/rss+xml" />
	<link>http://delx.net.au/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 07 Jan 2012 06:37:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Apple Keyboard on Linux</title>
		<link>http://delx.net.au/blog/2009/04/apple-keyboard-on-linux/</link>
		<comments>http://delx.net.au/blog/2009/04/apple-keyboard-on-linux/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 06:20:11 +0000</pubDate>
		<dc:creator>delx</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://delx.net.au/blog/?p=159</guid>
		<description><![CDATA[The Apple aluminium keyboards are very nice. I recently bought one for an Ubuntu Linux machine, and it requires some special configuration to work as expected. This post describes how to fix the function keys and swap command (windows or &#8216;super&#8217;) keys with the alt (or option) keys. This command will fix the function keys, [...]]]></description>
			<content:encoded><![CDATA[<p>The Apple aluminium keyboards are very nice. I recently bought one for an Ubuntu Linux machine, and it requires some special configuration to work as expected.</p>
<p>This post describes how to fix the function keys and swap command (windows or &#8216;super&#8217;) keys with the alt (or option) keys.</p>
<p><span id="more-159"></span></p>
<p><img src="http://delx.net.au/blog/wp-content/wp-uploads/2009/04/apple_aluminium_keyboardcompare.jpg" alt="Apple Aluminium Keyboard" width="400" height="292" class="size-full wp-image-160" /></p>
<p>This command will fix the function keys, it saves you pressing fn-F1 whenever you want F1. The first command is for older kernels, the second is for version 2.6.28 or later.</p>
<pre>
# echo 2 > /sys/module/hid/parameters/pb_fnmode
# echo 2 > /sys/module/hid_apple/parameters/fnmode
</pre>
<p>Then add that line to your <tt>/etc/rc.local</tt> file, somewhere before the <tt>exit 0</tt> at the end, so that it gets run on startup.</p>
<p>Next to swap the Command/Alt keys using xmodmap. I&#8217;m aware you can do this from the Gnome Keyboard Settings panel, but I&#8217;ve found this method works better. Particularly when combined with <a href="http://synergy2.sf.net">synergy</a>.</p>
<p>Create a file called <tt>~/.xmodmaprc</tt> with this inside:</p>
<pre>
clear mod1
keycode 115 = Alt_L
keycode 116 = Alt_R
keycode 64 = Super_L
keycode 113 = Super_R
add mod1 = Alt_L Alt_R
</pre>
<p>On another computer I&#8217;ve found this worked:</p>
<pre>
clear mod1
keycode 133 = Alt_L
keycode 134 = Alt_R
keycode 64 = Super_L
keycode 108 = Super_R
add mod1 = Alt_L Alt_R
</pre>
<p>Now run to activate the new keys, run:</p>
<pre>$ xmodmap ~/.xmodmaprc</pre>
<p>Don&#8217;t forget to add it to your list of startup programs. If you&#8217;re using Gnome, look at System->Preferences->Startup Applications<br />
Otherwise you can just add it to <tt>~/.xsession</tt></p>
<p>To find the keycodes above I used the <tt>xev</tt> program. Try running it from a console. It shows you all X11 events that the xev window receives, including key presses/releases.</p>
]]></content:encoded>
			<wfw:commentRss>http://delx.net.au/blog/2009/04/apple-keyboard-on-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

