Mac OS X keyboard layouts

I was reading macsurfer today and I came across an interesting article by a Canadian called Joe Clark who wanted to remove the US flag from the input mode menu item. This got me thinking, could I write something that would alter the default US keyboard layout to have a user specified flag. Could I write a keyboard layout with a Scottish flag for that matter.

It turns out that I didn’t need to.

There is already a Keyboard layout generator for mac osx. All you need to do is to enter a name for your new layout (“Scottish”) and then choose xml format. (You may also want to set the autodefine option to “define them all”) Then hit the download button. Finally save the resulting file as name.keylayout. (“Scottish.keylayout”).

If you want an icon to go with it you also need to create name.icns (“Scottish.icns”) using IconComposer or something similar.

Then drop the files into /Library/Keyboard Layouts/

Now logout and log back in again and the new keyboard layout should be available in the international pane for you to select. (hopefully)

But that isn’t the end of it. There’s more! The system is actually much cleverer than it seemed. You can set particular keys to generate combinations of characters. So if you want to do really odd things like have the number keys spell out the numbers as words that seems to be possible. (1 becomes ‘one’ for instance). Or maybe you dislike commas intensely, you would be able to redefine the keyboard layout to give space whenever you hit comma. It is also open to practical jokes of all kinds.

Tip: Check /Library/Keyboard Layouts/ if you’re getting odd effects when typing, someone may already have altered the layout.

This entry was posted in Macintosh. Bookmark the permalink.

One Response to Mac OS X keyboard layouts

  1. Chris Ryan says:

    Thanks for the info. I’ve tried similar things in the past but the icon never seems to be picked up–I get a default little keyboard icon. I created a full icon set and saved it into an .icns file using IconBuilder Pro 5. No luck.

Leave a Reply