VMware Communities
admin
Immortal
Immortal

tip: swap option and command keys (or windows and alt keys) in VM

Here's a tip for those running Fusion who are accustomed to non-Apple keyboards and have their fingers trained that the alt key is next to the spacebar and the key to the left of that is the Windows key. (Note that Apple keyboards have the Command or Apple key where the Alt key belongs and the Alt or Option key where the Windows key belongs.)

In Fusion beta 1, we've implemented an option to swap the Option and Command keys for the guest's consumption, so if you're using a non-Apple keyboard (or you are using an Apple keyboard but you can ignore what your eyes tell you about the labels on the keys, and just go with what your fingers already know), you can still drive Windows/Linux/etc. the way you're used to:

Open ~/Library/Preferences/VMware Fusion/config in a text editor (create that file as a plain text file if it doesn't already exist), and add this:

mks.keyboard.swapAlt = TRUE

Let us know if this is helpful!

Reply
0 Kudos
23 Replies
rcardona2k
Immortal
Immortal

Thanks! Seems to work fine. I fixed the keyboard differences between my work PC and my MacBook Pro by attaching an Apple USB keyboard to a Dell workstation (horror!) so my keyboards match everywhere. Smiley Happy

Reply
0 Kudos
admin
Immortal
Immortal

Ha. Evidently your fingertips are more retrainable than mine.

Reply
0 Kudos
Guddler
Enthusiast
Enthusiast

Heh, i did exactly that here too. After upgrading the Mac mini to the iMac i had a spare apple keyboard so i use it on my Dell (for work) all day. Now i really struggle with a standard UK keyboard. Just as well these apple one's are about the best feeling keyboards i've ever used. If they were "natural" shape too i'd be completely sorted.

I'd love to see some support for Apple UK keyboards in VM Additions. The downloadable UK map that someone privately produced isn't entirely 100% correct and i'm not sure if it will work in a Vista guest anyway. The only other guest i'm using right now is DOS and there aren't any additions for that anyway.

Reply
0 Kudos
admin
Immortal
Immortal

Key mapping is something we're looking at, so if you have examples of how the UK keyboard is mismapped, please let us know.

Oh, and btw, for those of you who now have Apple keyboards plugged into your Dells or other non-Apple PCs, the same "mks.keyboard.swapAlt=TRUE" may come in handy if you run VMware Workstation or Player under Windows or Linux with that Apple keyboard. FYI.

Reply
0 Kudos
rcardona2k
Immortal
Immortal

>the same "mks.keyboard.swapAlt=TRUE" may come in handy if you run VMware Workstation or Player under Windows or Linux with that Apple keyboard. FYI.

I was going to ask this but I thought it might be presumptuous. Thanks for sharing!

Reply
0 Kudos
rcardona2k
Immortal
Immortal

I think I'm having trouble undoing this setting. I tried to comment out this config by using # and the swap appears to remain. I also renamed config to xconfig so now I'm a bit baffled.

Is there any possibility this puts something in the Windows XP registry that is NOT undone by removing the option on the host?

Next time I look at vmware.log, I'll see if this setting is getting picked up somewhere else.

Reply
0 Kudos
oefe
Contributor
Contributor

How about an option to swap ctrl and command keys so that standard Mac shortcuts like commandC would be mapped to the corresponding Windows shortcuts, i.e. ctrlC?

Reply
0 Kudos
coopermj
Contributor
Contributor

Actually, what I'd love to see is a way of creating an , but haven't found one.

Reply
0 Kudos
bigrock0
Contributor
Contributor

key mapping would be grreat. for example, if i can map "delete" key to be "backspace" in fusion. i'm used to using backspace key for deleting characters, and now on fusion i have to use function and delete key at the same time.

also, it would be great if key mapping can be customized based on the type of keyboard. for example, when i plug in my microsoft usb keyboard, i don't want the same key mapping as i would on apple keyboard.

Reply
0 Kudos
dmgraham
Contributor
Contributor

I've been a frustrated Parallels user for months, having to resort to a Registry hack to swap the keys. I'm testing RC1 now (I love it!) and this tip has sealed the deal; I'm placing my order right now.

Thanks!

\- Dave

p.s. It would be nice to have in the GUI for those not inclined to go hunting through the forums, etc.

Reply
0 Kudos
dmgraham
Contributor
Contributor

I spoke just a little too soon. It turns out that the key swappingwhich is an absolute lifesaver btwdoesn't work in Unity mode; just full screen and single window. My fingers are crossed tightly hoping this gets fixed prior to release.

\- Dave

Reply
0 Kudos
dmgraham
Contributor
Contributor

Bummer... key swap still doesn't work under Unity in the 1.0 (51348).

Reply
0 Kudos
admin
Immortal
Immortal

Yeah, the keyboard swap option is ignored in Unity mode because:

\- a lot of Fusion users were asking for Command-(ZXCV) to work in their Windows apps they way they do in Mac apps, i.e., the ability to use the Mac keyboard shortcuts for undo/cut/copy/paste in Windows apps

\- since we're pretending the guest OS doesn't really exist as an OS and you just have guest apps running in the host OS, you want to use the host OS task switcher and window management keys, i.e., if you press command-tab/alt-tab, you want this interpreted by the host OS and not the guest OS.

I'd love to hear how you'd rather it work though -- IMO, just swapping the keys isn't the complete answer (in windowed or fullscreen modes, it's still not perfect, but it's close to the complete answer; in Unity mode, it's much farther from the complete answer). What's your dream keyboard interface to both Mac OS and Windows at the same time on the same keyboard?

Reply
0 Kudos
wdeboer
Contributor
Contributor

Hmm, would that be the reason why Ctrl-C for copying and such didn't work in Unity mode for me earlier this evening?

Reply
0 Kudos
mrfusion
Contributor
Contributor

magi,

My problems with key mappings stem from the fact that I'm a recent switcher to the Mac OS after about 15 years of using a Windows box, plus I have a development job which requires that I work with Windows extensively. To make it easier for me to switch back and forth between the two operating systems, I have used the Keyboard and Mouse "Key Mapping" dialog in the Mac's System Preferences to remap the Command (Cmd) key to the Control (Ctrl) key and the Ctrl key to the Cmd key.

This mapping is great because most key combinations in Windows use the Ctrl key and most key combinations in Mac use the Cmd key yet between the two \*physical* machines, it's basically the same for my poor fingers!

The big problem with this is that Fusion automatically maps the Windows Ctrl key to the Ctrl key on the Mac and since I've remapped it, the Mac's \*physical* Cmd key becomes the Ctrl key in Windows and now I'm back to the same problem of tripping over every single key combo I might try to do in Windows.

I wish Fusion let me remap keys the same way so that for Fusion, I could "remap my remapped" keys such that Ctrl goes back to the physical Ctrl key and Cmd goes back to the physical Cmd key, and this only when Fusion has the input focus.

Reply
0 Kudos
dmgraham
Contributor
Contributor

I'd love to hear how you'd rather it work though --

IMO, just swapping the keys isn't the complete answer\[...]

Magi:

You can't please everyone if you make the program work the way any particular user wants it to work. You really need to make the software flexible to accommodate every user's preference.

Here's my suggestion for a quick fix:

1. Trap specifically for Command+Tab in Unity, which I think nearly everyone can agree should invoke the Mac OS X application switcher.

2. Make it optional to re-map Command+C/X/V to it's Windows CTRL equivalents. Even though this isn't my preference, it likely should be the default behavior.

3. Honor the mks.keyboard.swapAlt = TRUE option in Unity. If somebody went through the trouble of editing a conf file that should really mean that they know what they are doing and want it! Smiley Wink

Longer term, I'd really like it if you created a more flexible Keyboard preference GUI that would allow people to implement all of their crazy ideas. You should be able to:

1. Decide whether to allow Fusion menu items while a VM is running. I can't tell you how many times I hit what I think is Alt+H only to accidentally hide the entire VM. (Yes, I know that these can be changed with OS X's Keyboard and Mouse preferences).

2. Allow any Mac key to be mapped to a Windows key equivalent.

3. Allow for specific mapping of Command to CTRL for the common equivalents (e.g., copy, paste, etc). Default=Enabled.

4. Add an option to override of Command+Tab in Unity regardless of mappings. Default=Enabled.

Microsoft's Mac RDP client[/url] handles this quite well, although they don't have the unique challenges of how to handle things in a Unity environment. Beyond that, I love the Keyboard preference options in the open source Chicken of the VNC[/url] application. It provides for custom key equivalents for different windowed environments, which I can see has a lot of parallels (no pun intended) with Fusion.

I'm a database and user interface developer and would love to assist and/or test with this. Please e-mail directly if you want.

\- Dave

Reply
0 Kudos
josquin
Contributor
Contributor

Sorry for the dumb question, but how do I the swap of the location of the control and command keys like I can do in Parallels? My fingers are trained to use Cmd-C, Cmd-S, etc. on the Mac side, and I would like to do the same in Windows.

Parallels has a simple option to do the switch. Is there a VMWare equivalent? Swapping the Command and the Alt keys are not quite what I want.

P.S. Loving VMWare, especially the extra memory space and virtual processor that I get over Parallels!

Reply
0 Kudos
daxab
Contributor
Contributor

Something about the swapAlt option doesn't play nicely with Remote Desktop Connection, by the way. I document this in gory detail in this other thread: http://www.vmware.com/community/thread.jspa?threadID=93476

Reply
0 Kudos
weipah
Contributor
Contributor

Is there also a way to change the second return key like on Macbooks as AltGr key?

This feature was very usefull in Parallels, because in windows you often do need backslash-characters.

Reply
0 Kudos