Apple Keyboard on Ubuntu: Italian style

2hoidsm

Default settings of Apple slim aluminium keyboard doesn’t fit my italian needs, so here is a brief note, just in case I have to reinstall Ubuntu.

In particular:

  1. “Pipe” and “backslah” keys are swapped to the < and > ones.
  2. Fucntion keys (F1, F2…) have less priority than “special keys” (brightness, volume) you must press Fn in conjuction to the function keys to have the standard behaviour
  3. “Insert” key is missing (the fn key took its place): it is useful for rapid cut and paste (Ctrl-Insert is copy, Shift-Insert is paste)

To fix 1 and 2, add these lines on /etc/rc.local before the exit 0

# swap < and / keys
echo 0 | sudo tee /sys/module/hid_apple/parameters/iso_layout

# function keys priority
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode

Reboot to take effect, it has system-wide effect.

To map the Insert key to the F13 key, add this line to ~/.Xmodmap (or create if you don’t have it)

keycode 191 = Insert

This setting is per-user based.

If you want to map Insert to another key, just grab the correct key code using this command:

xev | sed -n ‘s/^.*keycode *\([0-9]\+\).*$/keycode \1 = /p’

That’s all.

Annunci