Mac OS X Keyboard Layouts on Windows

Posted by Steve mid-evening on Sunday the 19th of March, 2006

Image courtesy of Ben

A while back, Ben was trying to replicate certain keyboard niceties from the wonderful Mac OS X in Windows. As a fellow superhero with an alter egoMac user by night, Windows user by day and utter pedant, I was intrigued, so decided to dig further into the problem.

Microsoft Keyboard Layout Creator

The Microsoft Keyboard Layout Creator seems the most obvious option to start with: it allows re-mapping of all of the standard keys on a keyboard (all the way across to the return key), along with the use of any of the Windows modifiers (Ctrl, Shift, and AltGr – which is the same as pressing Ctrl and Alt together; apparently Alt isn’t considered a Shift state by the Keyboard Layout Creator)

It’s easy enough to get most of the way to Mac OS X keyboard goodness: one can assign whatever characters to keys as one sees fit, assign values for the aforementioned modifiers, and generally make some pretty cool changes to your keyboard layout. This lets us get most of the way towards the dream of proper, nice OS X typography on Windows: you can rearrange the standard keyboard, set up AltGr to behave like the Mac’s Opt with lots of keys, and generally get most of the real niceness in OS X done, and using native Windows functionality.

Warning: the following will almost certainly make the characters shown on your keyboard not match those they produce in Windows (unless you use Windows through Virtual PC on Mac OS X, in which case they will match more). If you have to look at the keys to remember which is which, using this is not advised. I cannot be held responsible for you breaking/being unable to use your computer if you use this.

To save everyone the time and effort, however, I’ve already made a keyboard layout for Windows. To install the new layout, simply unzip the file and run the contained MacOSUK.msi. To then set the layout up for use, go to Control Panel>Regional and Language Options>Languages, click Details…, then click Add…, and set ‘Input Language’ to ‘English (United Kingdom)’ and ‘Keyboard layout/IME’ to ‘United Kingdom (Mac OS X)’. Click Ok, and then Apply.

With this, the Windows language bar should appear on your task bar. You can then switch between United Kingdom (Mac OS X) keyboard and whatever other keyboard layout you so choose. Alternatively, you could remove other keyboard layouts in the ‘Text Service and Input Languages’ (the one where you added the new layout), making the new Mac OS X style layout your default (and hiding the language bar).

Accent chords

The one thing that this doesn’t cover, though, is the neat little tricks you can do in Mac OS X to create characters like ñ: hold Opt and press n followed by n on its own, along with various others of a similar ilk.

Here is where AutoHotKey, that Ben mentioned, comes in: you can specify character replacement strings which are identified as you type (think auto-correct for letters). The observant members of the audience will already be thinking to themselves ‘but didn’t you just link to a homebrew keyboard layout to make our Windows keyboards just like those on the Mac, save a few keys?’

Why yes I did Billy, yes I did.

With a combination of AutoHotKey and our Mac-esque keyboard layout, we can have almost identical input on Mac and Windows, save the need, on Windows, to use AltGr in lieu of the Mac’s Opt.

Once again, because I’ve more time on my hands than is necessarily healthy, I’ve already made an AutoHotKey script for most of the easier accent chords. Notably absent are grave chords (due to what appears to be a bug in AutoHotKey’s Unicode handling, I felt compelled to leave them commented out) and all those chords that create characters with no extended-ASCII value.

To use it, install and run AutoHotKey, right-click the system tray icon and select ‘Edit This Script’. Copy and paste the contents of my script into this script (either overwrite or append it), save, and select ‘Reload This Script’ from the menu of AutoHotKey’s system tray icon.

That’s all, folks!

By this point, you should have Mac OS X style text input on your humble Windows computer. The only thing that’s missing now is switching the modifier keys so that they’re all laid out like the Mac but, thus far, I’ve not found any program that successfully achieves that. I’ll let you know when I do. 

Filed under

Something to say? Contact Steve (at journal@this domain) or link to this post from your blog.

10 comments

  1. Right: Finish this essay and then I’ll try this.

    I did have a crack with Keyboard Layout Creator a month or so back but the resultant layout I created promptly refused to compile, which was a bit of a bugger. I look forward to giving yours a try.

    Cheers Steve.

     Ben Ward
    6 minutes after the fact
  2. Nice website. I can’t believe you didn’t tell me when you formally “released” it (instead of just linking me to an IP address, hehe).

     NC
    5 hours, 12 minutes after the fact
  3. I guess this also has renewed interest now that they have managed to bootstrap Windows XP to run on Intel Macs. They are suggesting to use the MS admin tool remapkey.exe to make the MacBook Pro work better but are suggesting that the rest have no issue.
    Maybe these tips will assist those users who are brave enough to try this.

     Jonathan Relf
    14 hours, 44 minutes after the fact
  4. Brilliant job! I will definately try this at home. Do you think it would be difficult to convert it to a US version?

     Anton
    18 hours, 10 minutes after the fact
  5. Great tutorial, thanks. I love those little images you’ve got at the side of the article – lovely touch.

     Paul Farnell
    18 hours, 12 minutes after the fact
  6. @Anton: I don’t see any reason that a US version couldn’t be made. If you like, I can have a go at putting one together sometime this week? The mind-numbing act of matching letters from Mac OS’s keyboard viewer to Keyboard Layout Creator is actually quite soothing, in some perverse way.

    @Paul: Thanks, I’m glad you like them: they were something I actually only thought of a month or so ago, but never got off my arse and made them (which is why I only just posted this). They’re an idea that’s stolen from ‘The Elements of Typographic Style’, along with my use of sidenotes. I feel they add a little visual flair to the page without getting in the way of the content…

     Steve
    18 hours, 20 minutes after the fact
  7. Nice one! I really wanted this for Synergy to work properly and will probally help when i set up VNC!

    Cheers!

     Zach Inglis
    18 hours, 26 minutes after the fact
  8. Doesn’t the ‘Dead Keys’ bit if MSKLC do the multi key combinations you need? I make a UK layout for the MacBook Pro keyboard under windows, but I didn’t actually try the dead keys stuff, so maybe I misunderstood what that option was for.

     Mike Houston
    3 weeks, 4 days after the fact
  9. Hi… very nice site. But i have problems with your uttility. Your program put on place of right apple alt. That’s fine, but it should be alt gr. I don’t know is this only on my computer, but for me it is very big problem. If sombody know a solution, post it…. thanx

     aki
    5 months, 4 weeks after the fact
  10. Hi, thanks for the layout; I’ve adjusted it a little for US. I also added dead keys, so AltGr acts like mac option, i.e. so you can do opt-u u to get a u with an umlaut. Then all I had to use AutoHotkey for was to remap the windows key (where the mac option is) to AltGr. This makes the layout editing a little simpler because you don’t have to have lots of macros in AHK.

     Hugo Mallinson
    1 year, 5 months after the fact