How can I remap keys on an external keyboard, but keep the default layout on the internal?
KeyRemap4MacBook also supports device-specific settings:

&lt;?xml version="1.0"?&gt;
&lt;root&gt;
  &lt;devicevendordef&gt;
    &lt;vendorname&gt;KINESIS&lt;/vendorname&gt;
    &lt;vendorid&gt;0x05f3&lt;/vendorid&gt;
  &lt;/devicevendordef&gt;
  &lt;deviceproductdef&gt;
    &lt;productname&gt;ADVANTAGE&lt;/productname&gt;
    &lt;productid&gt;0x0007&lt;/productid&gt;
  &lt;/deviceproductdef&gt;
  &lt;item&gt;
    &lt;name&gt;modifierkeys&lt;/name&gt;
    &lt;identifier&gt;modifierkeys&lt;/identifier&gt;
    &lt;device_only&gt;DeviceVendor::KINESIS, DeviceProduct::ADVANTAGE&lt;/device_only&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::CONTROL_L, KeyCode::FN&lt;/autogen&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::FN, KeyCode::CONTROL_L&lt;/autogen&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::COMMAND_L, KeyCode::OPTION_L&lt;/autogen&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::OPTION_L, KeyCode::COMMAND_L&lt;/autogen&gt;
  &lt;/item&gt;
&lt;/root&gt;


You can see the vendor and product IDs from EventViewer.app. If it can't remap any keys on the external keyboard, try uninstalling other keyboard or HID drivers.

See the source for the key code values and predefined settings.