Or use PCKeyboardhack and I forget the other plugin but on a Mac, I have a brief caps lock mapped as esc, but holding it is control. it works effortlessley.
These sort of systems are a great way to remap keys; I wish such remapping was exposed by operating systems in a nice stock way.