Skip to main content

Apple Aluminium Keyboard on Linux

Since I'm a sucker for shiny things, and since I got used to the lovely keyboard on my Macbook, it only seemed right to get a new brushed aluminium keyboard for my non-Macbook computer. Well, that and a hand injury requiring me to have a keyboard with less than 1/16th of an inch key travel ...

I previously used it on Windows and getting it to work with Bootcamp was pretty easy. I even wrote instructions on my old blog. I've since started using it as my primary keyboard on my desktop machine with Ubuntu, and setting it up on there was even easier. There is a built-in keyboard map for it, and everything just works. I use the US layout because I'm more likely to type # than £, but altgr+3 produces the £ so all is good.

Unfortunately there are two things that irk me about this keyboard. First is that there is no insert key. Second is that you have to hold down Fn, which is where the insert key should be, to make the F keys work. Fortunately a bit of magic can make everything OK.

Building A New Insert


I decided to use F13, which is located directly above Fn, as a replacement insert key. I used xev to determine that the scan code of F13 is 191 (the others following on in a linear fashion). Making it into insert is just a bit of xmodmap magic, so put this line into .Xmodmap in your home directory.

    keycode 191 = Insert


That's it. It will be enabled when you log in. If you want to enable it immediately, type this:


    $ xmodmap .Xmodmap


Magic. You now have an insert key.


Fn-less F Keys


I found many, many blog posts by other people trying to figure out how to convert the media keys into standard F keys. Most of them spent time with xev trying to map the scan code of the F keys to the X11 function key mappings. This is a long winded and entirely unnecessary task if you have a 2.6.x kernel. Add this line to /etc/rc.local:


    echo 2 > /sys/modules/hid_apple/parameters/fnmode


On reboot, you will have standard function keys. The media keys are still accessible by holding down Fn, so it's the best of both worlds. If you are running Compiz, you could map the exposé keys to that. Of course, enabling it without a reboot is as simple as running that command as root.

Comments

Popular posts from this blog

Sheffield CAMRA 35th Steel City Beer Festival!

The first weekend of October has rolled around, so once again it is time for the Sheffield CAMRA Steel City Beer Festival. Now in its 35th year, the festival has seen a lot of change in the recent past. After the terrifying ordeal that was the Darnall Liberal Club, standing out in a field with beer seems like a much nicer proposition. Unfortunately, reviews of the 34th festival were tainted with dissatisfaction, both with the venue and the organisation as a whole. I didn't attend last year, but I attended this year with some trepidation. Thankfully, the whole event was better run than I had been led to believe, but not without its fair share of hiccups. Two marquees provided more indoor space, the place didn't smell like a donkey sanctuary, and the beer tasted great. There were around a hundred beers to try, and thirty ciders, so even more than some previous years. After a couple of false starts, our little troop of merry drinkers (myself, Emma and Chris) finally arrived at

iPhone OS 3.0.1 fixes SMS hijack bug

A lot of Apple haters have been rubbing their tiny hands with glee recently after news reports of a security flaw in the iPhone OS 3.0 that could allow hackers to "Hijack every iPhone in the world" . Many were quick to point out how slow Apple were for not releasing a patch, and many simply made it a soap box for "iPhone sucks, use Android" rants. However, on July 31st, Apple released iPhone OS 3.0.1, with a patch for this SMS issue. It installs easily enough, job done. Of course, not being privy to such information as how to hack my own phone with this exploit, I can't check if it does the job. Either way, there it is. A fix. More detail on the OS 3.0.1 release notes .

Why won't I leave me alone!?

Sometimes I just wish I could ignore my brain so I might be able to concentrate for ten minutes.