I use AHK to do this for Windows. It's a lifesaver, but it is not as reliable and it is very finicky -- the capslock to ctrl/escape usually works but sometimes it doesn't. AHK sometimes run into problem with Remote Desktop and Synergy.
Yes, I was really hoping to get something other that AHK. SharpKeys is much more stable to the point of where it pretty much "just works". It doesn't need a daemon running in the background.