tom robinson

Remap Caps Lock to “Search” on OS X (Google Cr-48 style)

One of the more intriguing features of Google’s new Cr-48 Chrome OS laptop is the lack of replacement of the caps lock key with a search key. I wanted to try this on my Mac. Here’s my hacky solution:

  • Install PCKeyboardHack to remap caps-lock to an unused key, for example one of the function keys (F1 is keycode 122 on my keyboard)
  • Create an AppleScript to open a new tab in Chrome (or your browser of choice). Here’s an example AppleScript.
  • Assign the previously chosen key to this service. Unfortunately OS X prevents you from assigning function keys to services directly. You can either create a Application Shortcut with the same name as the service (put the script in ~/Library/Services) in the Keyboard Shortcuts panel of the Keyboard pref pane, or you can use FastScripts (I had better luck with the latter)

Unfortunately there’s some lag compared to simply hitting “command-T”. Edit: saving the AppleScript as a script rather than an Automator action improved the lag considerably.

If you have a better way of doing this please send it my way.

Thanks to @MSch for the PCKeyboardHack suggestion, and @ryannielsen pointing me to FastScripts.


  1. tlrobinson posted this
To Tumblr, Love Metalab