Apple keyboard function key mapping in Ubuntu 10.10

I am a big fan of the Apple Keyboard with numeric keypad. It is flat like a laptop keyboard, has 2 USB ports and you can physically remap the keys to any layout you want (like Colemak). One other very nice feature is that keyboard has 19 function keys. Since programs generally don’t have shortcuts that are mapped to function keys higher than F12, this leaves 7 keys that can be used for global shortcuts. This is quite convenient on OS X, for example if you run Visor which gives you at the press of a single key.

I recently switched to Ubuntu 10.10 (Maverick Meerkat) and was very pleased to discover that the media function keys (forward, play/pause, …) work by default as long as you select the Apple Keyboard upon installation. Of course, this behavior can be changed – you can see some details here for example. Unfortunately, the F13-F19 keys are not mapped to F13-F19 but to something else. (I haven’t really looked at a PC keyboard in years, but I suppose it must be stuff like PrtScrn et. al.)

To get the F13-F19 keys back so that they can be used for global shortcuts, I’ve put the following script to run on Gnome startup:

xmodmap -e 'keycode 191 = F13'
xmodmap -e 'keycode 192 = F14'
xmodmap -e 'keycode 193 = F15'
xmodmap -e 'keycode 194 = F16'
xmodmap -e 'keycode 195 = F17'
xmodmap -e 'keycode 196 = F18'
xmodmap -e 'keycode 197 = F19'

xkbset exp m

As an alternative to Visor, I’m using Yakuake – it’s built on top of konsole and so is fairly customisable and solid.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: