Posts from: September '10
Here's a mini-HOWTO on the tweaks and hacks to turn the beautiful-but-temperament Apple aluminium keyboard into a PC-compatible one. Having used this gem for about an year now, I can testify: it's, without a doubt, the best keyboard I've ever worked with. It's comfort, quiet, fast, compact, prompts you to keep your fingernails short... you name it :)
The only hitch turns out to be the weird key locations of some symbols, and some Mac-influenced behaviour. You don't have an Insert button, there's a "Fn" button instead (see the picture above); F-keys don't behave as such, but rather do something (e.g., F12 is "volume up"); the numpad keys +, -, *, / are totally different; the key on the left of '1' is strange, it's not a tilde; and, the most painful thing - the Alt and Win keys are swapped (Alt is no more to the left of Space, but one key further left).
Fedora 13 applies the following logic in regard to these PC/Mac mismatches - a key does exactly what is written on it; even if that's different from what all people are used to do. Personally, I find that unacceptable, so here's how I restored a PC-compatible behaviour of the Apple keyboard:
1) Add the following two lines in /etc/rc.local:
echo "2" > /sys/module/hid_apple/parameters/fnmode
echo "0" > /sys/module/hid_apple/parameters/iso_layout
The first line makes the F-keys behave as real F-keys. To access the "action", combine with the "Fn" key. E.g., Fn + F12 turns the volume up.
The second line resolves the tilde issue, among other things.
2) Swapping the Alt and Win keys is best done by modifying the XKB scan-code interpretation file directly:
2.1) In Gnome->Preferences->Keyboard->Layouts, select "Evdev-managed keyboard" as your keyboard device.
2.2) Open /usr/share/X11/xkb/keycodes/evdev in a text editor. Search for any lines of the form "<LALT> = number", "<LWIN> = other number". Now you need to swap the numbers, corresponding to LALT and LWIN, and similarly for RALT and RWIN.
2.3) Restart X.
And that's it! Voilà!