Apple wired USB keyboard with numeric pad - working drivers for Windows 7 on an ordinary PC

Overview of the Apple Ultra-thin USB Keyboard Problem

I have a full-width Apple keyboard of the newer flat aluminium type (Ultra–thin USB) that I use with a regular PC and a Mac via a KVM. It works with Windows without any special drivers - to some extent - but unless you do something you won't have any ability to type Print Screen, Scroll Lock, Pause/Break or Insert keys.

When I looked on the internet to see whether there was a proper PC driver file for it, I found a lot of outdated, confusing, contradictory and muddled information. Some references are to very old versions of OSX or Boot Camp Tools, others to older versions of Windows or the keyboard itself.

I decided to write down what I had to do to make this keyboard work 'as intended' with Windows 7 from an up to date copy of Boot Camp Tools for OSX 10.6 Snow Leopard or 10.7 Lion.

I don't know if these instructions will help you with a wireless keyboard as I don't have one to try, but at least the information about Boot Camp Tools is up to date.

This is the device I'm talking about on Amazon.

Your options are:

  • Don't install new drivers, but use something like KeyTweak to remap scan codes manually for any keys you feel you are missing or hard to type. Insert and Print Screen are probably the most obvious annoyances, and you'll probably want Pause/Break too.
  • Install the Apple drivers that are included in Boot Camp Tools. If you do this, you can still use KeyTweak to modify things more to your taste.
  • Run a registry script that merges in scan code mappings for the missing keys - just doing what KeyTweak does but without the choice of what is what - I'm not going to say any more about this.
  • Do nothing - this is tolerable - as long as you don't ever need to use Insert, Print Screen, Scroll Lock, and Pause/Break - but chances are you do.

The Apple keyboard maps a few keys strangely: there is no Insert key, and Print Screen, Scroll Lock, and Pause/Break are not labelled. Also, Num Lock is labelled 'Clear'. Apple have their own pages on this topic, but surprisingly, they are partially incorrect.

Apple's own descriptions of how to type Print Screen, Scroll Lock, and Pause/Break are wrong - in fact these keys are activated in the following way:

  • Print Screen : F14
  • Scroll Lock : F15
  • Pause Break : F16
  • Insert : Fn + numeric Enter (Apple describe this correctly)

I suspect they have confused the key presses required for these with the presses you must make on the compact wireless keyboard, which has no F13 .. F19 keys.

Why they didn't assign these to F13, F14 and F15 so they align to the three function-key grouping above Fn, Home and PageUp, as would normally occur on a PC keyboard is beyond me as F13 isn't assigned to anything special.

How to install Apple's own Windows drivers for the wired Apple keyboard

You need a copy of Apple's Boot Camp Tools to do this.

You can download the latest Boot Camp Tools via the Boot Camp Assistant in OSX: run Boot Camp Assistant and select the option to download the latest support tools. Once the download is complete it will help you write them to a CD, DVD or external drive.

Apple don't publish a link to download Boot Camp Tools or the keyboard driver directly on their support site I find this irksome, but Apple don't seem to want PC users who didn't buy a Mac using their keyboard drivers; it's the only conclusion I can draw from Apple's decision to make the drivers only downloadable via an OSX utility; they could easily have submitted the keyboard drivers to Microsoft so that they were distributed with Windows 7, or put them on their own site, or on a CD, or made them freely distributable but they do none of these things.

There are various Boot Camp Tools related downloads on their site, but none appear to be the actual disc image. (If you can find a link, please let me know). If you don't have an OSX install disc you may be able to locate a copy of the driver install file by other means - see below.

I made a CD of my Boot Camp Tools. I suggest you do likewise, as it's convenient when doing a Windows install, or when you want to put the keyboard drivers on a new PC. The Boot Camp assistant will ask if you want to burn a discs after you have downloaded them. With the Boot Camp Tools disc in your PC, navigate to the correct directory:

If you have OSX 10.6 and a 3.X version of Boot Camp Tools

  • If you have a 32-bit Windows install go into: [your DVD drive]:\Boot Camp\Drivers\Apple and run AppleKeyboardInstaller.exe
  • If you have a 64-bit Windows install go into: [your DVD drive]:\Boot Camp\Drivers\Apple\x64 and run AppleKeyboardInstaller64.exe

If you have OSX 10.7 and a 4.X version of Boot Camp Tools

  • If you have a 32-bit Windows install go into: [your DVD drive]:\Drivers\Apple and run AppleKeyboardInstaller.exe
  • If you have a 64-bit Windows install go into: [your DVD drive]:\Drivers\Apple\x64 and run AppleKeyboardInstaller64.exe

Some guides will tell you that you need to run the main Boot Camp Tools setup (setup.exe) or the main driver installer (BootCamp.msi or BootCamp64.msi) - do not do this! The advice is wrong and in any event it's no longer possible. Apple have added a check to the main tools setup and main driver .msi to ensure that you're running on genuine Mac hardware, and if you aren't, you can't install. It used to be possible to run, but it is no longer an option. Even when it was possible it was a bad idea, as it could result in long delays on start-up. The keyboard driver installer doesn't contain such a check, so installing it standalone is still possible but I wouldn't be surprised if a future version of the driver will only work on Apple hardare - it would be obstructive in the extreme, but in line with other things Apple have done so far.

Making the top row of keys default to acting as function keys

The downside to running the keyboard driver install without the rest of the Boot Camp Tools is that you need to edit the registry manually to change how function keys are handled. By default the driver sets the top row of keys to perform multimedia functions (most of which don't work anyway, despite their being legitimate windows key messagers for them, they produce special Apple codes instead); and so you have to press the Fn key to make the top row keys produce functions key codes. What most people want/need is for the keys to produce function key codes by default and the broken multimedia functions when you press Fn - as Windows and most PC applications tend to use the function keys for a lot of useful short-cuts. There is an option in the Boot Camp Tools applet to change this behaviour, but it's also possible to change it without the applet.

The way that the driver handles the top row of keys is controlled by a single registry entry, so it's not hard to change it so that you don't need to press Fn to have them act as function keys by default:

Once you have installed the keyboard driver, run regedit using Start Menu >> Run and then navigate to:
HKEYLOCALMACHINE\SYSTEM\ControlSet001\Services\KeyMagic\OSXFnBehavior

There will be a 'Binary' entry with the value 01
You need to set this to zero. Some people say you should change this to a DWORD entry, but that's not true. However, to cover all contingencies, I edited the value to 00 00 00 00 - which is four bytes of zero, equivalent to a DWORD 0. This is easier than changing the type of the value and has the exact same effect. As far as the registry access API is concerned, four bytes of 00 and a DWORD value of 0 are the same.

Whatever the driver is doing to read the entry, I found that setting OSXFnBehavior to 00 00 00 00 did the trick, and afterwards my function keys worked as function keys without having to press Fn. You may need plug and unplug the keyboard to make this work after editing - the driver doesn't seem to check this value continuously.

With this configuration, you still need to press Fn + Enter on the numeric pad to type an Insert. You can always use KeyTweak to map something else (such as F13) to Insert but you can't remap the Fn key as it does not produce a key code. As an aside, the location of the Fn key where Insert is normally found on a PC keyboard was a terrible one, it makes it very hard to use on a Mac or PC and it's probably the worst thing about this keyboard - especially when moving back and forth from a MacBook keyboard that puts Fn on the far left.

I found that the track-forward, play/pause and track-back multimedia keys work as expected in iTunes, but the mute/unmute and volume keys do not. Unsurprisingly, the other special functions don't do anything either. If you inspect the scan codes generated for these keys (which, apart from Eject you access via the Fn key once you have the registry change in effect), you'll see there aren't any, so they can't even be remapped in KeyTweak. The Exposé and Dashboard functions produce the standard F3 and F4 scan codes even if you press Fn so they don't do anything special either.

If you don't have a copy of Boot Camp Tools

Without any driver installed, the keyboard allows you to use the function keys normally, and 'Clear' still works as Num Lock, which is fine but there is no way to type Insert, Print Screen, Scroll Lock or Pause/Break.

If you don't have access to Boot Camp Tools, really the best thing to do is to use KeyTweak. It doesn't install any services or anything that has to run at startup. In fact the only time it consumes resources is when you are running it explicitly to edit your settings. This is because it relies on functionality already built into Windows. It's merely a nice way of creating/editing a registry entry that already exists in Windows to support remapping of scan codes for non-standard keyboards.

The only downside of this is that it doesn't play well if you swap keyboards around because you may not want those alternate mappings applied to your other keyboards. If you don't use the Apple keyboard all the time, you may want to make registry scripts to turn the scan code remappings on and off.

An alternative is to somehow obtain a copy of the Apple driver. Apple go out of their way not to distribute it; they also explicitly prohibit redistribution in their license terms for Boot Camp Tools! So, I'm not going to upload a copy here.

However, a search for AppleKeyboardInstaller.exe soon turns up lots of people who don't seem to care about their license terms :) and have uploaded the file.
Of course, some of these may have been tampered with to contain malware, or may simply be very old versions that don't support Windows 7, or may do something else strange, so I've put the MD5 hashes for the most recent versions (at the time of writing) below so you can at least check anything you download.

Apple Keyboard Installer MD5 Hashes

Driver file name Boot Camp Tools Version   OS Version   MD5 Hash
AppleKeyboardInstaller.exe 3.2.2856 OSX 10.6 E5AE11C2AA0D9BCAF4A99EC55D0BD415
AppleKeyboardInstaller64.exe   3.2.2856 OSX 10.6 B4CDD38C5FC180A12C88371311039E8D
AppleKeyboardInstaller.exe 4.0.0.1 OSX 10.7 F0015AA3A67655A31417985B849E93D2
AppleKeyboardInstaller64.exe 4.0.0.1 OSX 10.7 5E41048519F031814E3FEF0B4948E80B