UK PC Keyboard Patch for Mac OS X

UKPCKeyboard is a program to patch Mac OS X to allow a UK layout PC keyboard to be used properly.

Catchy name, eh?

Rationale

The Apple UK keyboard layout is different to the standard PC keyboard layout - of course. Otherwise life would be too easy.

If you're like me, you would like to use your PC keyboard with your Mac - in my case, I have the keyboard on a USB switch, so I can switch one keyboard between Mac and PC. This works fine - both my PC and Mac can handle the USB keyboard (and mouse) being switched away and back again.

However, on the Mac, the differences in layout between UK versions of the Mac and PC keyboards cause problems. In particular, the at sign (@) and double-quote (") characters are swapped. This is intensely annoying. There are other annoyances such as the backslash key not working, and the # key inserting a backslash, and so on.

I wrote this kernel extension to fix these problems. At the moment, my patch does the following:

Key pressed Key passed to Mac OS X Result
Shift-2 Shift-' Pressing Shift-2 gives you the " character.
Shift-' Shift-2 Pressing Shift-' gives you the @ character.
# Option-3 Pressing # gives you the # character.
Shift-# Shift-` Pressing Shift-# gives you the ~ (tilde) character.
\ # Pressing \ gives you the \ character.
Shift-\ Shift-# Pressing Shift-\ gives you the | (pipe) character.

The grave key (`) is supposed to generate the '' character when pressed, but I don't know the key code of the key to generate this under Mac OS X, so at the moment it is left unmodified, and Shift-` will give you the ~ (tilde) character. In any case, I've never met anyone who knows what the '' character is for, let alone anyone who uses it.

How to Install

(These instructions are shamelessly stolen from the DoubleCommand web page.)

  1. Remove any older versions of UKPCKeyboard, DoubleCommand, iJect, uControl or PowerDelete (see below for how to do that). These are conflicting software.
  2. Open a Finder window and go to the Library folder directly on your Mac OS X startup volume. (There are several folders named Library. I mean the one in the root of the startup volume, not in the System folder)
  3. If there is a folder named StartupItems, drop the UKPCKeyboard folder into it. The UKPCKeyboard folder is in the StartupItems folder in the distributed disk image.
  4. If there is no StartupItems folder, drop the whole folder StartupItems from the distributed disk image directly into the Library folder. You should have created a directory hierarchy like this in any case:

      /Library/StartupItems/UKPCKeyboard

  5. Restart the computer

After rebooting, the keyboard patch will be active. If you open TextEdit or Terminal or anything else you can type into, you should see that the troublesome keys have been fixed.

NB. You need Administrator rights to install startup items, but you do not need to be the Unix super user "root". The user account which is created during installation of the operating system has administrator rights.

Issues

  • This patch is only designed for UK layout PC keyboards running on Mac OS X.
  • Future upgrades to Mac OS X may break this patch, due to the techniques used.
  • Mac OS X 10.2 (Jaguar) features a new ABI (Application Binary Interface) due to Apple migrating to GCC 3.x, and the extension has to be recompiled to make it work on Jaguar. Therefore there are two versions of the extension in the download section - choose the one appropriate to your version of Mac OS X.

It should run on Mac OS X 10.1.1 and upwards, but so far I have only tested it on:

  • Mac OS X 10.1.5
  • Mac OS X 10.2.1

Download

Platforms: Mac OS X

License: GPL

Copyright: Tim Browse, 2002 (and Michael Baltaks and Christian Starkjohann)

Status: Completeness: 9/10, Reliability: 10/10

Version History

Version 1.0.1d1

Updated to fix the remaining problem keys (see table above).

NB. I have only produced a Jaguar version of this version - if you want an updated version for Mac OS X versions earlier than 10.2, email me and I'll see what I can do.

Version 1.0.0d1

The original version. Seems to work ok.

Acknowledgements

Many thanks to:
  • Michael Baltaks, for DoubleCommand, which I shamelessly pulled apart and changed to make my own kernel extension.
  • Christian Starkjohann, for iJect, which is the extension that Michael based DoubleCommand on.
  • Edward Tsang, for making me get around to fixing the remaining keys.
Basially, Christian seems to have done the hard work of hooking the IO manager, and then made that code available under the GPL, so that Michael Baltaks and I can use it for our own nefarious purposes. Hurrah! :-)