Opened 15 years ago

Closed 13 years ago

#2996 closed defect (fixed)

Swapped keys in german keyboard layout -> Fixed in SVN

Reported by: Dirk Nitschke Owned by:
Component: GUI Version: VirtualBox 2.1.0
Keywords: keyboard keymap Cc:
Guest type: Solaris Host type: Mac OS X


Running Open Solaris 2008.11 (64-bit) or Solaris 10U6 x64 (64-bit) as guests. On command line (even without X), the <> and keys are swapped. "<" prints "^" and ">" prints "°".

locale settings are:

eeprom keyboard settings are:

Change History (26)

comment:1 by Harald Stuebinger, 15 years ago

Also reproducible on host Mac OS X Leopard and guest Windows Vista x64. The keys ° and <> are swapped. Also, the ALT GR key is not working.

Virtualbox Version 2.1.2.

comment:2 by Harald Stuebinger, 15 years ago

To be precise: I have the following configuration: There is not the normal Apple keyboard attached. I have attached the German Microsoft Natural Keyboard 4000. This keyboard has special keyboard drivers from Microsoft. On the upper right Apple menu bar, the selection for the keyboard language shows two entries: One "German" and another one "German Microsoft". I have to select "German Microsoft" to ensure that this keyboard on the host works correctly. All keys of the keyboard works correctly on the host. However on every guest OS (Linux, Windows), there are some keys swapped or not working.

Best regards from Germany, Bavaria, Nuremberg

comment:3 by Harald Stuebinger, 15 years ago

Still reproducible in version 2.1.4. Please fix this. It is really problematic for a programmer since important keys are not working.

comment:4 by Gunnar Payer, 15 years ago

Apearently I am not the only one with this particular problem. I have seen questions about this also in the forum, but also not answered. I am running Mac OS X 10.5 on a MacBook Pro as host and Debian lenny as guest. There is an external german keyboard attached without special drivers. The '</>' and the '/°' keys are swapped on both the external and the build-in keyboards. The problem existed with older versions, currently I am running 2.1.4. It would realy be nice, if this was fixed, as I am also like my colleague a developer, this time Linux.

comment:5 by ha42, 15 years ago

See also ticket #4006. I have the same problem with a Windows XP guest on a Macbook with OS X 10.4.11. On a german keyboard the keys </>/| (to the right of the left shift key) and ^/° (left to the key 1/!, below ESC) are swapped.

The problem is not new, I had this also on earlier versions (since 1.6 I belive). Could you please fix this? It is really annoying - try to write some HTML or XML with this keys swapped!

comment:6 by Dirk Nitschke, 15 years ago

Still the same behaviour with VirtualBox 2.2.4 r47978 and corresponding guest additions SUNWvboxguest 2.2.4,REV=r47978.2009. <> and ° are swapped.

comment:7 by Dirk Nitschke, 15 years ago

Still reproducible in VirtualBox 3.0.6 r52128 with SUNWvboxguest 3.0.6,REV=r52128.2009.09.09.1932 on Mac OS X 10.6 host and Solaris 10U7x86 (64-bit) guest.

comment:8 by LarsV33, 15 years ago

Since the bug is still not fixed, I just remapped the keys inside windows.

  • Use notepad or another editor to create an file with the name remap-keys.reg on the desktop and put the following content into it:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
    "Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,56,00,29,00,29,00,56,00,\

  • Import this into your registry by double click on remap-keys.reg
  • Log off/on or reboot.

Hope that helps everyone until the bug is fixed.


P.S. As an alternative you can also use sharpkeys to create the mapping:

comment:9 by adsworth, 15 years ago

add me to the list of stillreproducible. Host: MacBookPro SnowLeopard german keyboard running VirtualBox 3.0.6 Guest: ArchLinux

comment:10 by Technologov, 15 years ago

This bug seems related to bugs #1494 #4006


comment:11 by Technologov, 15 years ago

Another duplicate found: #5185

comment:12 by walter, 14 years ago

Lars workaround works also on Italian keyboard, Thanks so much Lars!

comment:13 by michaln, 14 years ago

For future reference: If anyone has keyboard related problems, we need to know the host keyboard layout. This is Apple's reference: If a non-Apple external keyboard is used, we need to know that too.

Also, keyboard mapping problems depend on the guest. It's worth pointing out that many Mac keyboard layouts are different from PC keyboards, with the notable exception of US and German keyboards. For many keyboard layouts, the key caps on a Mac will not match what a guest expects, even when everything is working correctly. That includes the UK and International English layouts.

But yes, on some keyboard layouts, two keys are swapped. Apple probably used some strange non-US keyboards a long time ago, and they now internally swap the key to the right of the Left Shift and the key to the left of '1' for backwards compatibility. This swapping applies only to keyboards identified as "ISO (European), ISO/IEC 9995 standard keyboard" - that is, most non-US keyboards. VirtualBox needs to undo the swapping, but only if the OS actually applied it.

comment:14 by michaln, 14 years ago

Component: otherGUI
Keywords: keymap added
priority: majorminor

comment:15 by Christian Pötzsch, 14 years ago

Summary: Swapped keys in german keyboard layoutSwapped keys in german keyboard layout -> Fixed in SVN

Fixed in SVN. The fix will be included in the next minor version.

comment:16 by Claudio Nieder, 14 years ago

I have this issue and my keyboard is "Swiss Apple Keyboard".

comment:17 by Christian Pötzsch, 14 years ago

This fix is for all Apple ISO keyboards.

comment:18 by michaln, 14 years ago

To explain in case it's not clear... Apple internally swaps the keys for all "ISO" keyboards. Those are all keyboards whose physical layout is not US or Japanese. In practice that means all keyboards which have an extra key between the Left Shift and 'Z' keys (or 'Y' on German keyboards).

comment:19 by michaln, 14 years ago

We've made a test build available here - please try out this build and report if that fixes the swapped keys.

in reply to:  19 comment:20 by Claudio Nieder, 14 years ago

Replying to michaln:

We've made a test build available here - please try out this build and report if that fixes the swapped keys.

I tested this build and it fixes the issue for my MacBook Pro with keyboard layout "Swiss Apple Keyboard".

I attached an external keyboard from an iMac with layout "Swiss Apple Keyboard with Numeric Keypad". System Profiler reports this as

Apple Pro Keyboard:

Product ID: 0x020c Vendor ID: 0x05ac (Apple Inc.) Version: 4.10 Speed: Up to 12 Mb/sec Manufacturer: Mitsumi Electric Location ID: 0x04130000 Current Available (mA): 250 Current Required (mA): 50

With this keyboard and 3.2.11 the key mapping is correct too.

I attached another external keyboard which is a keyboard for PCs. soulArt Colorblind  ACK-2080UM also with a swiss german layout. System Profiler reports this as

USB Keyboard:

Product ID: 0x0101 Vendor ID: 0x0a81 (CHESEN ELECTRONICS CORP.) Version: 1.10 Speed: Up to 1.5 Mb/sec Manufacturer: CHESEN Location ID: 0x06200000 Current Available (mA): 500 Current Required (mA): 100 Current Required (mA): 100

For this keyboard 3.2.11 also gives the correct key mapping.

Thank you very much for fixing this bug.

comment:21 by Georg Schwarz, 14 years ago

Unfortunately, even with that test build (VirtualBox-3.2.11-67664-OSX.dmg) provided, there is still the following probably related issue:

Host OS: MacOS 10.5.6, Apple USB Keyboard with extended keypad, German layout (ProductID: 0x0221 vendor ID: 0x05ac (Apple Inc.)) (Virtual Box says "Apple, Inc Apple Keyboard [0069]") Guest OS: NetBSD 5.1 for AMD/64 (installed from amd64cd-5.1.iso Image) Set German console keyboard in guest OS's text console settings (encoding de.nodead), which results in y and z being correct as on the physical German layout. However, most keys to be input using the Alt key do not work when using the left Alt key. In vi one sees that they do produce some input codes, but apparently no printable characters. When using the right Alt key, I do get some results, but wrong ones: Alt-7 yields { instead of | Alt-8 yields [ instead of { Alt-9 yields ] instead of } Alt-0 yields } instead of ≠ (which would probably not be printable on the Unix shell)

There are probably further examples. It seems like Virtual Box even in that test build is still assuming a US keyboard layout in some aspects.

comment:22 by michaln, 14 years ago

geos: No, VirtualBox is not assuming any keyboard layout. It tries to pass keystrokes from the host to the guest based purely on the location of the keys on the keyboard, not the labels on the keys. After all, neither VBox nor the host OS can tell what the labels are. It's up to the guest to make sense of the key codes.

What you describe sounds like the keymap in your guest doesn't behave the way you think it should, but that has nothing to do with VirtualBox. I expect that NetBSD 5.1 behaves exactly the same on a physical host like it does in a VM; only if it doesn't it may be a VirtualBox bug.

At any rate, it has nothing to do with the subject of this ticket, which is two specific keys being swapped on certain keyboards.

comment:23 by Frank Mehnert, 13 years ago

The fix is contained in VBox 3.2.12.

comment:24 by Jens Elkner, 13 years ago

Yes, this one is fixed, but keyboard emulation is still buggy. E.g. you switch into numeric keypad mode (fn+F6) [and back] the '#' (USB scancode 50) as well as '<' (USB scancode 100) do not work anymore. With dtrace (see Solaris keytables HowTo) one can verify, that the keystation actually produces the appropriate scancode, however the console does not echo it anymore - gets lost somewhere. Also unwanted key repetition occures more often as in the previous release (3.2.10), i.e. even if the keystation gets pressed for a very short/normal time, the mapped character gets echoed several times on the console and thus leads to garbage commands, login problems ...


comment:25 by Mikael Eiman, 13 years ago

Seems like #1871 is the same problem.

Unfortunately I still have the same problem in 3.2.12 with my Macally ICEkey keyboard (ProdID 0x0005, MfgID 0x2222).

comment:26 by michaln, 13 years ago

Resolution: fixed
Status: newclosed

elkner: If you have a different problem, please open a different ticket (or add to an existing ticket dealing with the same issue, if there is one). By mixing up several unrelated problems you're only making it less likely that anything will get fixed.

m_eiman: #1871 describes a completely different problem. If you have that problem, please add any useful information to that ticket. This ticket deals with two specific keys that were swapped on certain keyboards (regardless of the key caps or the keyboard layout selected in the host and/or guest). The Mac international keyboards are not the same as PC keyboards, so using a Mac keyboard with a PC operating system (and vice versa) is going to be troublesome.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use