Jul 222015
 

For the longest time I have had caps lock set to “no action” in System Preferences >> Keyboard>> Modifier Keys:

caps-lock-no-action

 

But recently I’ve been playing with Vim (and also finally getting around to learning how to touch type) a little more now that I have some time on my hands, and decided that I needed an escape key that wasn’t such a PITA to get to without risking breaking my left pinkie. Enter Karibiner
 

Karabiner bindings are stored in ~/Library/Application Support/Karabiner/private.xml the syntax of which is pretty easy to follow, and so I have entry in this file that maps caps lock to escape on the one hand, and also as a “hyper” modifier key when pressed in conjunction with certain other keys. The “code” for this is”
 

    <!--    the "hyper key"
           caps locks mapped to escape;
           used as a super modifier when when pressed in conjunction with other keys.
           keys modified with hyper to perform specic actions definied in:
           ~/Library/Application Support/Karabiner/private.xml
           ~/.hammerspoon/init.lua
           or Keyboard Maestro
           initial mapping of caps lock to F19 done in seil.appendix
   -->
    <item>
            <name>F19 to F19</name>
            <appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix>
            <identifier>private.f192f19_escape</identifier>
            <autogen>
                --KeyOverlaidModifier--
                KeyCode::F19,
                KeyCode::COMMAND_L,
                ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L,
                KeyCode::ESCAPE
            </autogen>
        </item>

 

But, apparently, the caps lock key is a “special” key— at least on Macbook Pro keyboards, and some additional configuration needs be done before entries to Karabiner’s private.xml will take effect. The fundamental new mapping of caps lock is therefore done in seil  (a “utility for the caps lock key and some international keys in PC keyboards.”):

seil-mapping-caps-lock

 

Here it is mapped to OS X character code 80 (the F19 key). A complete list of OS X key codes can be seen by executing:
 

grep '^ *kVK’ /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h|tr -d ,|while read x y z;do printf '%d %s %s\n' $z $z ${x#kVK_};done|sort -n
Feb 092012
 

So I borrowed a mate’s external USB superdrive in order to get some old files off of archived CDs, and the internal optical drive in my April ’08 MacBook Pro has long since shit the bed. Requirements for the drive suggest that an Air is required (Apple website, original packaging and a call to an Apple store), and sure enough when plugged into the MBP running Lion (10.7.2)… no dice.

I’ve been toying with geting some sort of Apple certification/credential, so I’ve a not unreasonable collection of old (and new tech docs from them). Reading through that I came to the following:

as root, edit:
/Library/Preferences/SystemConfiguration/com.apple.Boot.plist
after:
<key>Kernel Flag</key>
add entry:
<string>mbasd=1</string>

Recycle the machine…. and Boomshaka!

Social Widgets powered by AB-WebLog.com.