VirtualBox

Ticket #373 (closed defect: fixed)

Opened 7 years ago

Last modified 18 months ago

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

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

Description (last modified by michael) (diff)

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

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

Change History

comment:1 Changed 7 years ago by frank

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

comment:2 Changed 7 years ago by da1l6

Same problem with VBox 1.4.0 :(

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

comment:3 Changed 7 years ago by michael

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

comment:4 Changed 7 years ago by adeodato

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

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

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

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 Changed 5 years ago by alex.s

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

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

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

comment:10 Changed 5 years ago by harald_nuernberg

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

comment:11 Changed 5 years ago by stef

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 Changed 4 years ago by Technologov

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

-Technologov

comment:13 Changed 4 years ago by sandervl73

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

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

comment:14 follow-up: ↓ 15 Changed 4 years ago by nathanael

  • Status changed from closed to reopened
  • Resolution fixed deleted

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).

comment:15 in reply to: ↑ 14 ; follow-up: ↓ 16 Changed 4 years ago by nathanael

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.

comment:16 in reply to: ↑ 15 Changed 4 years ago by nathanael

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 Changed 4 years ago by nathanael

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 Changed 4 years ago by michael

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

comment:19 Changed 4 years ago by nathanael

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

comment:20 Changed 4 years ago by sunlover

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 Changed 4 years ago by nathanael

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 Changed 4 years ago by sunlover

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

Changed 4 years ago by nathanael

Log with VRDP connection and missing AltGr mapping

comment:23 Changed 4 years ago by nathanael

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 follow-up: ↓ 25 Changed 4 years ago by 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: {[]}|\~@

comment:25 in reply to: ↑ 24 Changed 4 years ago by martint

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).

Changed 3 years ago by hamzadis

A workaround for the issue using LD_PRELOAD filtering.

comment:26 follow-up: ↓ 27 Changed 3 years ago by hamzadis

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.

comment:27 in reply to: ↑ 26 ; follow-up: ↓ 28 Changed 3 years ago by michael

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.

comment:28 in reply to: ↑ 27 Changed 3 years ago by hamzadis

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 Changed 3 years ago by michael

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 Changed 3 years ago by michael

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 Changed 3 years ago by hamzadis

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 Changed 3 years ago by michael

  • Summary changed from AltGr-Key (German Keyboard) not working to AltGr-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 Changed 3 years ago by michael

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

comment:34 Changed 3 years ago by kek

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 Changed 3 years ago by kek

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 Changed 3 years ago by gix

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 follow-up: ↓ 38 Changed 3 years ago by michael

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

comment:38 in reply to: ↑ 37 Changed 3 years ago by gix

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 Changed 3 years ago by michael

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

comment:40 Changed 3 years ago by michael

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 Changed 3 years ago by michael

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 Changed 3 years ago by gix

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

comment:43 Changed 3 years ago by michael

Fixed committed today.

comment:44 Changed 3 years ago by michael

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

comment:45 Changed 3 years ago by frank

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

Fixed in VBox 4.1.4.

comment:46 Changed 2 years ago by czw

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 Changed 2 years ago by michael

  • Status changed from reopened to closed
  • Host type changed from other to Linux
  • Resolution set to fixed

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 Changed 19 months ago by gerardlambert2001

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 Changed 19 months ago by gerardlambert2001

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 Changed 19 months ago by masap

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 Changed 19 months ago by qiet72

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 Changed 19 months ago by masap

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 Changed 18 months ago by michael

  • Status changed from reopened to closed
  • Resolution set to fixed
  • Description modified (diff)

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.

www.oracle.com
ContactPrivacy policyTerms of Use