VirtualBox

Opened 17 years ago

Closed 12 years ago

#373 closed defect (fixed)

AltGr-Key (German Keyboard) not working -> fixed in 1.4.2, comment 34 fixed as of 2 Oct 2011

Reported by: da1l6 Owned by:
Component: other Version:
Keywords: Cc:
Guest type: other Host type: Linux

Description (last modified by Michael Thayer)

The AltGr modifyer Key on german keyboards is not working, so Chars requiring it can not be typed. This includes \ ~ and |

Host: Kubuntu 6.10 Edgy Eft Guest: Windows 2000 VM: VBox OSE Rev.O2723

Attachments (2)

VBox.log (49.2 KB ) - added by nathanael 14 years ago.
Log with VRDP connection and missing AltGr mapping
keymod2.c (704 bytes ) - added by Adis Hamzic 13 years ago.
A workaround for the issue using LD_PRELOAD filtering.

Download all attachments as: .zip

Change History (55)

comment:1 by Frank Mehnert, 17 years ago

What Xorg keyboard settings do you use for the host? Did you try with VirtualBox 1.4.0?

comment:2 by da1l6, 17 years ago

Same problem with VBox 1.4.0 :(

XKeyboard Settings on Host: XkbRules "xorg" XkbModel "pc105" XkbLayout "de" XkbVariant "nodeadkeys"

comment:3 by Michael Thayer, 17 years ago

Did you set the keyboard layout correctly in the guest system?

comment:4 by adeodato, 17 years ago

I suffer this problem as well, but only when running over ssh. This is the situation:

  • when running VirtualBox in a local display, AltGr works fine.
  • when running VirtualBox over ssh -X, AltGr does not work, BUT:
  • over ssh -X, the AltGr key works in other applications, eg. xterm: it only stops working with VirtualBox.

Host system and ssh server is Debian sid running non-OSE 1.4.0-21864, guests system are Debian testing and Windows XP (AltGr does not work in either), ssh client is Debian sid.

The Xorg keyboard configuration in the ssh client is:

Option "CoreKeyboard" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "es"

Please let me know if I can provide more information, or run any tests. I'd really love to see this fixed.

And thanks for the terrific product, BTW!

comment:5 by Michael Thayer, 17 years ago

Resolution: fixed
Status: newclosed

Confirmed: AltGr is no longer working in VirtualBox 1.4.0 using a remote X server. This will be fixed in the next SVN update and in version 1.4.2.

comment:6 by Harald Stuebinger, 15 years ago

Resolution: fixed
Status: closedreopened

Still reproducible with Virtualbox 2.1.2

AltGR key does not work on host Mac OS X Leopard and guest Windows Vista x64 with german keyboard layout. PS/2 keyboard driver loaded at guest.

comment:7 by alex.s, 15 years ago

I can confirm this bug with Windows XP SP3 as host and guest system (VirtualBox Version 2.1.2).

The AltGr key of the host system only doesn't work, if you minimize the virtual machine by clicking on it's icon in the taskbar. If you minimize it with the minimize icon of the window, the AltGr key works fine.

comment:8 by Harald Stuebinger, 15 years ago

To clarify it, when I opened a text editor on the host: all keys are working correctly. But when I opened a text editor on the guest, there are the following problems identified with German Keyboard layout on guest: ALT-GR does not work. <> key seems to be swapped with key °.

Virtualbox: 2.1.2 Host: Mac OS X Leopard Guest: all (at least Vista, Ubuntu, openSuse

comment:9 by Harald Stuebinger, 15 years ago

On host Mac OS X Leopard, it doesn't matter whether minimized. I is always reproducible.

comment:10 by Harald Stuebinger, 15 years ago

Still reproducible in 2.1.4. Is there a fix??? It is really problematic not having some important keys.

comment:11 by Stefano, 15 years ago

Had a similar (or the same) problem:

  • Windows host, Linux guest
  • AltGr working in virtual consoles but not under X (slackware 12.2)

Upgrading to VirtualBox 2.1.4 without upgrading the add-ons left the AltGr key dead, while upgrading the add-ons fixed it

comment:12 by Technologov, 14 years ago

Really strange bug, considering the fact, that VirtualBox made by Germans !

-Technologov

comment:13 by Sander van Leeuwen, 14 years ago

Resolution: fixed
Status: reopenedclosed

No reaction for along time. Please reopen if it still applies to 3.0.10 or newer.

comment:14 by nathanael, 14 years ago

Resolution: fixed
Status: closedreopened

It's still not fixed in VirtualBox 3.1

I'm connecting to a VM using VRDP.
When I use tsclient (rdesktop) on a ubuntu computer, AltGr works fine.
When I use mstsc.exe on a windows computer, AltGr doesn't work.

I have a Swiss-French keyboard (similar to German keyboard).

in reply to:  14 ; comment:15 by nathanael, 14 years ago

A can be more specific after some tests.
My guest is Ubuntu, I have access to a virtual keyboard that highlights the pressed keys.

When I press AltGr key, it highlights the CtrlL key. The key seems to be incorrectly mapped.

in reply to:  15 comment:16 by nathanael, 14 years ago

Some more :

If I press CtrlL + AltGr then the keys are correctly detected.
But this combination doesn't allow to use the characters like { } [ ] because of CtrlL...

comment:17 by nathanael, 14 years ago

I think I have the most relevant informations on this issue.

Watch this post and its replies : http://www.cygwin.com/ml/cygwin-xfree/2009-06/msg00001.html

Windows seems to generate a CtrlL event for each pressed or released AltGr. This behavior is handled for Windows to Windows communication, but not for Windows to Linux because Linux doesn't understand this. It explains why the Linux to Linux is working fine.

Perhaps the good solution would be to filter this CtrlL event if followed by an AltGr (in the client additions for linux depending on the host).

comment:18 by Michael Thayer, 14 years ago

I wonder though, is this a VBox issue, or shouldn't rdesktop be "swallowing" the additional events?

comment:19 by nathanael, 14 years ago

rdesktop is OK
And I wouldn't expect microsoft to fix this with mstsc.exe ...

comment:20 by sunlover, 14 years ago

nathanael, I've tested the Swiss-French layout in Ubuntu 9.10 guest in VBox 3.1.0 and Alt-Gr seems to work over VRDP with mstsc client.

What was the version of mstsc.exe? Which "virtual keyboard" application have you used?

comment:21 by nathanael, 14 years ago

I tried with the terminal server client from my up-to-date windows xp, and from a windows server 2003. AltGr doesn't work. I had to change the "third level" activation key in my ubuntu settings and now I'm able to use the []{} characters.

The host is Ubuntu server 9.10 (same problem if the host is Ubuntu desktop 9.10 or 9.04). I didn't try with a Windows host.
VirtualBox 3.1.0 configured with default parameters (installation from the offical depot).
Guests are Ubuntu desktop 9.10

The virtual keyword is from the "add keyboard" menu in Ubuntu :
(my ubuntu is in french so i'm unsure for the menus in english) :
FR: Système/Préférences/Clavier puis onglet "Agencement" (le 2e) et le bouton "Ajouter"
EN: System/Preferences/Keyboard then the second tab and the button "Add"

You should have a keyword that highlight the pressed keys.

comment:22 by sunlover, 14 years ago

Please attach VBox.log of the Ubuntu VM with reproduced problem.

by nathanael, 14 years ago

Attachment: VBox.log added

Log with VRDP connection and missing AltGr mapping

comment:23 by nathanael, 14 years ago

I've attach the requested file.

I tried to configure my Windows (ts client) with French keyboard layout and then Ubuntu (vm) with French too but still the AltGr key wouldn't work. I can't test from a fresh install for now. Perhaps there's a link with the Ubuntu host keyboard configuration.

comment:24 by Martin, 14 years ago

Hi,

I installed VirtualBox today (3.1.4) so I'm pretty new to this (FYI, if you ever ask for logs or anything).

I'm using Windows XP as host and have installed Ubuntu 9.10 as guest. My keyboard has a Swedish layout and I also needs to use the Alt-Gr key to get some characters (blue in the linked image).

I can reach three of the Alt-Gr characters, the £, $ and µ (Alt-Gr+3, Alt-Gr+4 and Alt-Gr+m) but non of the others: {[]}|\~@

in reply to:  24 comment:25 by Martin, 14 years ago

Replying to martint:

Hi,

I installed VirtualBox today (3.1.4) so I'm pretty new to this (FYI, if you ever ask for logs or anything).

I'm using Windows XP as host and have installed Ubuntu 9.10 as guest. My keyboard has a Swedish layout and I also needs to use the Alt-Gr key to get some characters (blue in the linked image).

I can reach three of the Alt-Gr characters, the £, $ and µ (Alt-Gr+3, Alt-Gr+4 and Alt-Gr+m) but non of the others: {[]}|\~@

Missed one important thing :S. I was using Synergy 1.3.1 from another windows computer to the host computer. When using Synergy input on the host the Alt-Gr characters are no problem, but on the guest they don't work. If I use the keyboard connected directly to the host all Alt-Gr characters work.

Sorry for the spam. I completely forgot that I was using Synergy (that is how good it works).

by Adis Hamzic, 13 years ago

Attachment: keymod2.c added

A workaround for the issue using LD_PRELOAD filtering.

comment:26 by Adis Hamzic, 13 years ago

As this was not yet fixed I was forced to make a workaround. I have attached the source file of my workaround ( keymod2.c ). The file is an LD_PRELOAD library that filters X11 key events and modifies them so that the extra ControlL modifier is removed. To compile it, run

$ gcc -o keymod2.so -fPIC -shared keymod2.c

Copy the resulting library to /usr/lib and then add this in a script called at boot or at logon:

export LD_PRELOAD=/usr/lib/keymod2.so

Note: I have not tested the script extensively so it is possible that it might have issues with some apps.

in reply to:  26 ; comment:27 by Michael Thayer, 13 years ago

Replying to hamzadis:

As this was not yet fixed I was forced to make a workaround. I have attached the source file of my workaround (...)

Could you please give more details about how your system is set up? On my Ubuntu 10.10 with X.Org Server 1.9 and standard German layout, xev shows the state as 0x90 when AltGr is held down.

in reply to:  27 comment:28 by Adis Hamzic, 13 years ago

Replying to michael:

Could you please give more details about how your system is set up? On my Ubuntu 10.10 with X.Org Server 1.9 and standard German layout, xev shows the state as 0x90 when AltGr is held down.


The modifier state in X11 includes other modifiers as well (CapsLock, NumLock, ScrollLock).

On my system, when the NumLock is on, xev displays 0x90 which is a combination of 0x80 (AltGr) and NumLock (0x10). When doing the same via Remote Desktop from windows, xev shows 0x94 which is a combination of 0x80 (AltGr), NumLock (0x10) and ControlL (0x04).

So the code detects 0x84 and removes the 0x04. Try turning the NumLock off and checking xev again.

PS: I use Arch 64bit with the croat keymap.

comment:29 by Michael Thayer, 13 years ago

Turning off NumLock of course removes the 0x10 (sorry, I am a bit slow today), but doesn't make the 0x4 appear. Just to be clear, are you using the standard VirtualBox front-end (i.e. the VirtualBox binary rather than say !VBoxHeadless)? And how exactly is the guest reacting when you don't preload your library? On the one hand I tend to say that if your remote desktop client/server (is this VNC?) is sending an additional !ControlL that is their problem and not ours, but actually I have a feeling that your fix shouldn't change anything in our code, so I would still like to understand this.

comment:30 by Michael Thayer, 13 years ago

Could you please also check how the host modifier state as reported by xev matches the guest state as reported by whatever is handiest for the guest?

comment:31 by Adis Hamzic, 13 years ago

Well it seems I have misidentified this ticket - my solution fixes AltGr interoperability when using VRDP with the Microsoft Remote Desktop Client.

This is a problem experienced by Virtualbox users:
http://forums.virtualbox.org/viewtopic.php?f=3&t=238
http://forums.virtualbox.org/viewtopic.php?f=6&t=3842

As well as by users of other similar products:
http://support.microsoft.com/kb/963709
http://communities.vmware.com/message/1640503

I'm sorry for the confusion my comments may have caused.

comment:32 by Michael Thayer, 13 years ago

Summary: AltGr-Key (German Keyboard) not workingAltGr-Key (German Keyboard) not working -> fixed in 1.4.2

No problem, working to locate problems is the whole point of bug tickets.

comment:33 by Michael Thayer, 13 years ago

Resolution: fixed
Status: reopenedclosed

comment:34 by Karl Eklund, 13 years ago

Resolution: fixed
Status: closedreopened

This doesn't seem to be fixed. I'm using version 4.0.10 with Windows 7 as host and Arch Linux as guest. Swedish keyboard set on host and guest.

Output of xev when I press AltGr and release it:

KeyPress event, serial 33, synthetic NO, window 0x3600001,
    root 0x173, subw 0x0, time 80636, (574,291), root:(575,356),
    state 0x2000, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x3600001,
    root 0x173, subw 0x0, time 80637, (574,291), root:(575,356),
    state 0x2004, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x3600001,
    root 0x173, subw 0x0, time 80681, (574,291), root:(575,356),
    state 0x2084, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x3600001,
    root 0x173, subw 0x0, time 80681, (574,291), root:(575,356),
    state 0x2080, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

When I press AltGr-2, it sends Ctrl-@.

comment:35 by Karl Eklund, 13 years ago

I have also tried hamzadis's hack but it didn't seem to work. Tried putting the LD_PRELOAD line in ~/.xinitrc, /etc/rc.conf or /etc/rc.d/gdm.

comment:36 by gix, 13 years ago

AltGr stopped working after 4.0.4. Using 4.0.4 xev lists only ISO_Level3_Shift, and no Control_L event. Keys are working fine (Windows 7 Professional 64-bit as host, Ubuntu 11.04 64-bit as guest, no headless VM).

For every version I tried after that (4.0.6, 4.0.8, 4.1.2) it is broken as described above: Pressing AltGr sends a wrong Control_L event and renders those keys unusable.

comment:37 by Michael Thayer, 13 years ago

gix: did you actually test that by re-installing 4.0.4 and seeing if the problem went away again?

in reply to:  37 comment:38 by gix, 13 years ago

Replying to michael:

gix: did you actually test that by re-installing 4.0.4 and seeing if the problem went away again?

Yes, I downgraded to 4.0.4 every time (and still use 4.0.4 for now) because of this issue.

comment:39 by Michael Thayer, 13 years ago

What host key combinations are the people using who are seeing the spurious LControl events?

comment:40 by Michael Thayer, 13 years ago

And does it make a difference whether the keyboard is captured (see the keyboard indicator next to the host key display in the bottom panel)?

comment:41 by Michael Thayer, 13 years ago

I hope that this stable branch test build will fix the problem:

https://www.virtualbox.org/download/testcase/VirtualBox-2011-09-29-18-11-07-win-4.1-rel-4.1.3-r74233-MultiArch.exe

As usual, please do not use this build for anything mission critical, and if you test it please report the results.

comment:42 by gix, 13 years ago

I'm using "Break" as host key. And the r74233 build resolves the problem for me. Cheers!

comment:43 by Michael Thayer, 13 years ago

Fixed committed today.

comment:44 by Michael Thayer, 13 years ago

Summary: AltGr-Key (German Keyboard) not working -> fixed in 1.4.2AltGr-Key (German Keyboard) not working -> fixed in 1.4.2, comment 34 fixed as of 2 Oct 2011

comment:45 by Frank Mehnert, 13 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in VBox 4.1.4.

comment:46 by Jens Bäckman, 12 years ago

Resolution: fixed
Status: closedreopened

Bug is still there in both 4.1.4 and 4.1.6.

  • Host: Mac OS X 10.7 Lion
  • Guest: Gentoo GNU/Linux (same bug appears with Debian)
  • Keyboard: Swedish

Steps to reproduce:

  1. Set guest keyboard layout to Swedish
  2. Set host keyboard layout to Swedish
  3. Press AltGr+2. This should produce @.

Letters like ÅÄÖ work just fine, so the general keyboard handling is OK. However, @ (produced by AltGr+2) doesn't appear. This bug makes it almost impossible to write C++ code, as |[]{} are all accessed through AltGr key combinations.

comment:47 by Michael Thayer, 12 years ago

Host type: otherLinux
Resolution: fixed
Status: reopenedclosed

This ticket was actually for Linux hosts, despite the fact that it was re-opened for a Windows host issue. I am pretty sure that there are more suitable tickets for similar issues on Mac hosts (if #1871 looks like what you are experiencing you could add a "me too" comment to subscribe to it.)

comment:48 by gerardlambert2001, 12 years ago

Resolution: fixed
Status: closedreopened

I reproduced this problem with Virtual Box 4.2.

I have a Win7 64 host and a Ubuntu 12.04 guest. I use a Belgian layout in both host and guest, just like German layout I need AltGr to type @ and most programming symbols.

Since it seems to be a very long running bug, does someone have a workaround?

comment:49 by gerardlambert2001, 12 years ago

I have an additional comment:

The inability to use the alt gr key only happens when the guest is displayed in full screen. When the guest is windowed, everything goes fine and I can type the @{}[] characters normally.

comment:50 by masap, 12 years ago

I can confirm the problem described above (host : w7-64b, guest Ubuntu12.04.1 32b.), with a french keyboard layout (tried with variants, no success). AltGr key is unavailable when guest is displayed full screen, but goes fine when guest is windowed. The same problem occurs even when in guest rescue mode.

comment:51 by qiet72, 12 years ago

Hi,

Here is the events when you press "Alt-Gr 2" (Danish keyboard) which should produce "@" but instead produces nothing in full screen mode:

KeyPress event, serial 36, synthetic NO, window 0x4a00001,
    root 0x139, subw 0x4a00002, time 634710, (42,36), root:(108,88),
    state 0x94, keycode 11 (keysym 0x40, at), same_screen YES,
    XLookupString gives 1 bytes: (00) ""
    XmbLookupString gives 1 bytes: (00) ""
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x4a00001,
    root 0x139, subw 0x4a00002, time 634775, (42,36), root:(108,88),
    state 0x94, keycode 11 (keysym 0x40, at), same_screen YES,
    XLookupString gives 1 bytes: (00) ""
    XFilterEvent returns: False

Here is the events when you press "Alt-Gr 2" which produce "@" as expected but in windowed mode:

KeyPress event, serial 36, synthetic NO, window 0x4800001,
    root 0x139, subw 0x4800002, time 554182, (37,35), root:(755,87),
    state 0x90, keycode 11 (keysym 0x40, at), same_screen YES,
    XLookupString gives 1 bytes: (40) "@"
    XmbLookupString gives 1 bytes: (40) "@"
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x4800001,
    root 0x139, subw 0x4800002, time 554252, (37,35), root:(755,87),
    state 0x90, keycode 11 (keysym 0x40, at), same_screen YES,
    XLookupString gives 1 bytes: (40) "@"
    XFilterEvent returns: False

Here are the differences:

    XLookupString gives 1 bytes: (40) "@" # Windowed mode
    XLookupString gives 1 bytes: (00) ""  # Fullscreen mode

This bug only happens on the MS Windows version of VirtualBox running Ubuntu Guest, the Linux version of VirtualBox does not have this problem. To me, it looks like VirtualBox has problems sending combo key events when used with Alt-Gr so Alt-Gr in itself seems to work as it should. I have tried to workaround it by playing around with xmodmap but I have not had success yet.

comment:52 by masap, 12 years ago

Tried this : launch the guest in fullscreen mode, log in, launch 2-3 apps (ie terminal, gedit and firefox). Then try to switch between apps with <alt><tab> : it doesn't work the first time you press the combo. Repeat <alt><tab> until you get the task panel appearing (press the keys 3-4 times). Then you're able to switch between apps and, surprise : the AltGr key is now working in fullscreen mode... Strange no ?

comment:53 by Michael Thayer, 12 years ago

Description: modified (diff)
Resolution: fixed
Status: reopenedclosed

This ticket concerns an issue specific to X11 hosts which was indeed resolved years ago. Since the issue you are reporting occurs on Windows hosts, could you create a new ticket for it? Thanks.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use