A MacOS X Keyboard Layout for Programming
I have previously created my own keyboard layout for windows and Linux in order to have a layout where the often-used keys in programming are more accessible than in the standard Norwegian layout. And when I recently got a (shiny) MacBook pro, I wanted to have the same keyboard layout for the Mac also. Consistency is key across machines, so the layout is the same as in the original progn keyboard layout (most braces and slashes available on home row or the row above). Downside is if decide to update it, I have to update three copies. Oh well…
In the windows and Linux I ended up mapping caps-lock to alt-gr and binding a lot of new key combinations using that modifier. I chose a similar although slightly different model for the Mac. I choose to use the caps-lock key as another alt key (set in the keyboard system preference) and then map keys to alt+
Home row is the most important one, with often used characters, and the braces on homerow+1 on the right hand. Pointy brackets and pipe on the left hand.
Here’s how I created the new keyboard layout for mac running 10.6 Snow Leopard (I think it’ll work on Leopard (10.5) as well, but haven’t tested it). Finding an existing layout in the .keylayout XML format was quite difficult but I found an extended Norwegian layout which had some often used keys already mapped nicely, like norwegian quation marksand some others. So I used that as a base.
- Download Ukulele from the web page and install it.
- Either start from scratch defining keys in Ukelele or start modifying an existing keyboard layout.
- Open the character viewer (System preferences -> Language & Text -> Input Sources and select Character and keyboard viewer
- Drag characters from the character viewer while holding down the desired modifier key.
- Save under a suitable name. Be creative :-).
- Copy to “/Library/Keyboard Layouts” for access for all users or “~/Library/Keyboard Layouts” for just your user.
- log out and log in, and you should be able to choose the new keyboard layout from System Preferences.
I called my keyboard layout progn, like the others I have created and you can download it if you want to use it for further tweaking. I made it available under the same creative commons license as this blog, so remixing is allowed provided you make the re-mixed versions available to the world wide intertubes.blog comments powered by Disqus