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.
On my chromebook pixel, there is a super/windows key (labeled as a "search" key) where the capslock normally is on a US keyboard. Since I use super as the prefix key for all of my window manager shortcuts, I use xcape (https://github.com/alols/xcape) to allow that key to function both as super (if I hold it down) and as escape (if I tap it).
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.