Autohotkey

swap caps and ctrl

CapsLock::Ctrl
#If !GetKeyState("RAlt")
Ctrl::CapsLock
#If

swap caps and escape

Capslock::Esc