November 23rd, 2012 at 10:48 pm by Dr. Drang
I’m not sure where I first saw a link to this detailed keyboard post by Steve Losh. The usual suspects would be Brett Terpstra, Gabe Weatherhead, and Clark Goble, but I’m thankful to whoever it was. Losh’s post has given me a great new tool for making keyboard shortcuts easier.
The central conceit of Losh’s post is to recreate the experience of the legendary Space Cadet keyboard on a Macintosh using today’s hardware and software. The Space Cadet came with the old Symbolics Lisp machines of the 80s and is renowned for its row of four modifier keys—Control, Meta, Super, and Hyper—that allowed users and programmers to define an enormous number of keyboard shortcuts. I’m not a big fan of doing everything from the keyboard, but there was one section of the post that I thought would give my keyboard use a big boost.
The problem in defining new keyboard shortcuts is that you want to make them relatively easy to type while not conflicting with shortcuts already defined. I tend to use Control-Option-Command combinations because
- Applications shy away from three-modifier combos, which leaves them free.
- Despite it being three keys, that combination is actually easy to type because the keys are all in a row. I just mash down on them with the ring, middle, and index fingers of my left hand—no fine motor control necessary.
But after using up the Control-Option-Command combinations that have an easy mnemonic association with their function, it becomes harder to add new functions. An obvious extension would be to start using Shift-Control-Option-Command, but that’s hard to type. Which is where Losh’s software recommendations come in.
The two applications—System Preferences, actually—Losh discusses are PCKeyboardHack and KeyRemap4MacBook, both of which are free programs written by Takayama Fumihiko. A simple variation on Losh’s instructions allowed me to remap the Caps Lock key on my MacBook Air to the Shift-Control-Option-Command combination. Now I can add more keyboard shortcuts without sacrificing ease of typing.
First, I followed Fumihiko’s instructions for installing both of his programs. Then I opened the builtin Keyboard System Preference and set the Caps Lock Key to No Action.
Then I opened the PCKeyboardHack Setting pane and remapped the Caps Lock key to keycode 80, which corresponds to F19 on keyboards that have an F19. Function keys on my MacBook Air max out at F12, so mapping Caps Lock to F19 causes no conflict.
Next I opened KeyRemap4MacBook (which, despite its name, isn’t restricted to MacBooks) and opened its
private.xml document from the Misc & Uninstall pane.
I set the contents of my
private.xml to this,
xml: 1: <?xml version="1.0"?> 2: <root> 3: <item> 4: <name>Remap Caps Lock to Hyper</name> 5: <appendix>OS X doesn't have a Hyper. This maps Left Control to Control + Shift + Option + Command.</appendix> 6: 7: <identifier>caps_lock_to_hyper</identifier> 8: 9: <autogen> 10: --KeyToKey-- 11: KeyCode::F19, 12: 13: KeyCode::COMMAND_L, 14: ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L 15: </autogen> 16: </item> 17: </root>
which is a minor rewrite of Losh’s
private.xml. After saving and closing this file, I switched to KeyRemap4MacBook’s Change Key pane and activated the new entry.