Monday, March 30, 2009

Change Keyboard Type on Mac OS X

I had an interesting experience with Mac OS X (10.5.6 for the record) today: I use a KVM switch to connect a single keyboard, monitor, and mouse to a number of computers. I swapped my Microsoft Comfort Curve Keyboard 2000 for a Unicomp Customizer 105 (which rocks, by the way!) and started typing away. To my dismay, the ^° key was recognized as <> - and vice versa.

The keyboard layout was still correctly set to a German layout but Mac OS X thought that the KVM switch was the actual keyboard (it certainly identifies itself as a HID). So it looks like Mac OS X can not see that the keyboard type has changed and the wonderfully simple process that works when connection a keyboard directly fails to even get started.

I started system preferences and went to "Keyboard & Mouse". The following window opens:

[caption id="attachment_338" align="alignnone" width="503" caption="Mac OS X 10.5.6 System Preferences > Keyboard & Mouse > Keyboard"]Mac OS X 10.5.6 System Preferences > Keyboard & Mouse > Keyboard[/caption]

If you now click on "Change Keyboard Type ..." (circled in red above), the Keyboard Setup Assistant opens and asks you to press the key to the right of the left shift key. This allows Mac OS X to detect your keyboard type and your non-Apple keyboard will work just fine.

For whatever reason Mac OS X did not show the button "Change Keyboard Type ..." to me at all, which meant that I could not change the keyboard type. A little bit of delving into the system was clearly required ...

In /System/Library/CoreServices I found KeyboardSetupAssistant.app, which sure looked like what I was looking for! Unfortunately, it quit itself immediately. A little bit of console magic revealed the following error message:

No unknown keyboard connected - terminating

It turns out that if you get this error message, you delete /Library/Preferences/com.apple.keyboardtype.plist and restart your Mac. Upon booting the Keyboard Setup Assistant will start and identify your keyboard.

Seems like a lot of hoops to jump through to solve a simple problem. If you know a better solution, please leave a comment to share your knowledge!

No comments:

Post a Comment

I'd love to hear from you! Please remember to keep it civilized.