My question relates to the System Preferences parameter, which allows you to reassign Caps Lock , for example. Ctrl .
^ Is it possible to programmatically change this parameter?
First of all, I would be interested to achieve this through defaults or some kind of shell trick; second time through AppleScript (yuck).
I know that maybe I can achieve this using third-party tools like KeyRemap4MacBook, but this is a last resort. But I would prefer, if possible, a third-party solution.
My use case:
Using the Maestro keyboard and its nice macro triggers, I'm looking for the ability to automatically reassign Caps Lock -> Ctrl in applications like MacVim, and switch them back to regular Caps Lock when exiting affected applications.
source share