Friday, June 29, 2012

Remapping the Macbook keyboard for Windows


So I've been super impressed with how well the MacBook Air manages to run Windows and Mac OS simultaneously using Parallel, much better than my MacBook Pro, both seem to run effortlessly even for graphic intensive applications. But took a while to figure out how to remap the keyboards. So here, mostly for my memory in case I need to do it again

First I needed PC Keyboard Hack which is only necessary to remap Caps Locks. But that's important for me since I have adapted the Unix convention of using that for Ctrl. If you don't care about that you can bypass this first step.

First I disabled caps locks, under the keyboard options.

Then used pckeyboardhack to (mac osx allows some limited remapping functionality of caps locks, but their version creates some delay issues)

remap Caps lock to Control_r

This solves the remapping problem for Windows, but for Mac OS, I'd want Caps Locks to be Command rather than Control, (e.g. copy and paste in windows is ctrl-C, ctrl-V, but it is command-C and command-V in macOS).

So then I installed keyremapformacbook with the following options selected


Command l to option l (only in virtual machine)
Option l to command l only in virtual machine

So that Command L acts as Alt in the virtual machine (otherwise the default Parallels mapping has the location of Alt and Win reversed)

Command r to home
Option r to end

Since home and end are not on the keyboard, and using Fn is annoying especially when I use shift or ctrl with home or end.

Command arrow and command delete work differently in Mac-OS. Option Arrow and Option Delete have the same functionality so:

command delete to option delete
command arrow to option_l arrow

To fix Caps Locks for within MacOS, I want the following option which for some reason is not a default option.

control_r to command_r (except in virtual machine)

Fortunately, Keyboard Remap offer an extensive XML language that lets you create your own re-mappings.
<?xml version="1.0"?>
<root>
 <item>
    <name>Control_R to Command_R (except in virtual machine, RDC)</name>
    <identifier>private.ctrlrtocmdrexceptvirtualmacine</identifier>
    <not>VIRTUALMACHINE</not>
    <not>REMOTEDESKTOPCONNECTION</not>
    <autogen>--KeyToKey-- KeyCode::CONTROL_R, KeyCode::COMMAND_R</autogen>
  </item>
</root>
Finally, to make up for the missing Page Up and Page Down keys, I used Sharpkeys in Windows to Remap F11 and F12. F11 and F12 seem to key in MacOS to remap universally, but I use Ctrl-Page Up and Ctrl Page Down to much in Chrome, so I added the application shortcut Ctrl-F11 and Ctrl-F12 in MacOS to select Next and Previous Tab within Chrome. It still frustrates me that unlike Windows, where every menu item is accessible by keyboard, MacOS is just the opposite, it at least allows nice flexibility in creating keyboard shortcuts. I lastly remapped Option/Alt F, to select the menu bar as well.
Post a Comment

Amazon Contextual Product Ads