<p>I use a MacBook, but I've got a usual keyboard attached to it.</p>

<p>The problem is that the keys don't exactly map 1-to-1. One thing is the APPLE and ALT keys. They map to WIN and ALT, but they are usually physically inverted, so if you want to use them with the same layout you have to invert them in the OS.
The Function keys work differently too. Fx on the external = Fn + Fx on the MacBook keyboard. And then there are all the insert, delete, keys.</p>

<p>So, the question is, how do you come around this? Now I remap all the things I want at the System Preferences panel, but when I unplug the external keyboard it's all messed up. Is there a way to remap keys only for the external one? Some model of keyboard can store it's own mappings without needing the OS? Am I the only one who is bothered by this?</p>

<p>(I would like to avoid buying an external mac keyboard, because I wanted to try one of the ergonomic models, and as far as I know, there are no mac ergonomic models)</p>

<p>Update:
Thanks for the responses, I fixed this.</p>

<p>To set the control keys for different keyboards, you have to go to System Preferences/Modifier Keys, then the drop down menu Select Keyboard allows you to choose one particular keyboard and set these keys. Works after unpluging/pluging it seems</p>

<p>The suggestion from @Matthew Schinckel seems to work for the rest of the issues (function keys, ...). I didn't try it yet, as the commands keys were my biggest gripe.</p>

[{'answer_id': 56846, 'author': 'Matthew Schinckel', 'author_id': 188, 'author_profile': 'https://Stackoverflow.com/users/188', 'pm_score': 1, 'selected': False, 'text': "<p>You could investigate DoubleCommand, it may do what you need.</p>\n\n<p>There's an experimental version that allows for different properties for different keyboards.</p>\n"}, {'answer_id': 56942, 'author': 'pauldunlop', 'author_id': 2152, 'author_profile': 'https://Stackoverflow.com/users/2152', 'pm_score': 2, 'selected': False, 'text': '<p>You create create your own custom keyboard mapping, which could then be used with the keyboard language menu. So when you plug in your keyboard, just switch to your custom layout. OS X has supported this since 10.2, and Apple has documentation on how to produce your own custom maps.</p>\n\n<p><a href="http://developer.apple.com/technotes/tn2002/tn2056.html" rel="nofollow noreferrer">http://developer.apple.com/technotes/tn2002/tn2056.html</a></p>\n\n<p>It\'s not something I\'ve tried myself, just read about it once or twice. Looks like it could potentially do the job. I\'d just duplicate a mapping that is as close as you can get to what you want, and then customise it from there.</p>\n'}, {'answer_id': 56952, 'author': 'emeryc', 'author_id': 3900, 'author_profile': 'https://Stackoverflow.com/users/3900', 'pm_score': 6, 'selected': True, 'text': "<p>In OS X 10.5 they allow you to have different keyboard setups for different keyboards. This works most of the time. I've had issues with very old keyboards that are plugged in via a PS2 to USB but otherwise it works fine.</p>\n"}, {'answer_id': 56995, 'author': 'Joe Chin', 'author_id': 5906, 'author_profile': 'https://Stackoverflow.com/users/5906', 'pm_score': 3, 'selected': False, 'text': "<p>The best method I have is to download the Logitech Control Center for OSX from Logitech. Search throw the Installer package for the LCCKCHR.rsrc. Drop this file into either ~/Library/Keyboard Layouts or /Library/Keyboard Layouts. Logout and log back in and you'll notice a few more options in the International System Preferences under Inputs. Check the keyboard layouts you would like.</p>\n\n<p>Although this keyboard layout is for Logitech keyboards it works for most keybaords (especially international users)</p>\n"}]
['https://Stackoverflow.com/questions/56553', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3785/']