I described in an earlier post how to switch keyboard bindings on an Apple keyboard using Ubuntu using Xmodmap. Now, this works great, however I do use the external keyboard just at home with my laptop docking station. When on the move it gave me the unpleasant side-effect that the keybindings on the laptops keyboard were switched too, making the previous fix on the external keyboard a pain on the laptop keyboard.
This is Cuttlefish enters the game, it was created within the 2012 Ubuntu App Showdown and was one of the best submissions. It is a tool that helps you trigger a specific event upon a defined stimulus. In my case I have two possible stimuli, either the external keyboard is connected or it is not. For either scenario there is a reaction described in the above figure.
Using this setup it enables me to type on either keyboard as I am used to. Cuttlefish can be installed via PPA:
sudo add-apt-repository ppa:noneed4anick/cuttlefish sudo apt-get update sudo apt-get install cuttlefish