Ticket #2996 (closed defect: fixed)

Opened 12 years ago

Last modified 10 years ago

Swapped keys in german keyboard layout -> Fixed in SVN

Reported by: ms3a512 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

comment:1 Changed 12 years ago by harald_nuernberg

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 Changed 12 years ago by harald_nuernberg

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 Changed 12 years ago by harald_nuernberg

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 Changed 12 years ago by gunnar

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 Changed 12 years ago by ha42

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 Changed 12 years ago by ms3a512

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 Changed 11 years ago by ms3a512

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 Changed 11 years ago by LarsV33

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 Changed 11 years ago by adsworth

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

comment:10 Changed 11 years ago by Technologov

This bug seems related to bugs #1494 #4006


comment:11 Changed 11 years ago by Technologov

Another duplicate found: #5185

comment:12 Changed 11 years ago by walter.recaldini

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

comment:13 Changed 10 years ago by michaln

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 Changed 10 years ago by michaln

  • Keywords keymap added
  • priority changed from major to minor
  • Component changed from other to GUI

comment:15 Changed 10 years ago by poetzsch

  • Summary changed from Swapped keys in german keyboard layout to Swapped keys in german keyboard layout -> Fixed in SVN

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

comment:16 Changed 10 years ago by claudio_

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

comment:17 Changed 10 years ago by poetzsch

This fix is for all Apple ISO keyboards.

comment:18 Changed 10 years ago by michaln

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 follow-up: ↓ 20 Changed 10 years ago by michaln

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

comment:20 in reply to: ↑ 19 Changed 10 years ago by claudio_

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 Changed 10 years ago by geos

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 Changed 10 years ago by michaln

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 Changed 10 years ago by frank

The fix is contained in VBox 3.2.12.

comment:24 Changed 10 years ago by elkner

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 Changed 10 years ago by m_eiman

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 Changed 10 years ago by michaln

  • Status changed from new to closed
  • Resolution set to fixed

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.
ContactPrivacy policyTerms of Use