#2537 closed defect (fixed)
ALT key state not reset when leaving guest -> fixed as of VirtualBox 4.2.14
Reported by: | Jelle Geerts | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 2.0.4 |
Keywords: | Cc: | ||
Guest type: | other | Host type: | Windows |
Description (last modified by )
It regularly happens that when leaving the guest I can't press Windows + E key to open "My Computer" (on the host).
This is caused by the ALT key state being set (possibly other keys are also affected by the bug).
I've tested the bug with the following guests:
- Windows 95
- Arch Linux
Change History (33)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Seems fixed in VirtualBox 2.2.4 (although it's not listed in the changelog), can others confirm this?
comment:3 by , 15 years ago
Aw, I found out it still occurs. For a second it seemed to be fixed, but I'm afraid it isn't.
comment:4 by , 15 years ago
Okay, this problem of loosing the keyboard focus in XP guests on a linux host, described IMHO best in #2412, is really annoying, and occurs quite frequently for myself in windowed or fullscreen in my configuration which is Linux Host 2.2.4 r47978 with XP guest and latest guest tools. It seems to occur semi-frequently whenever my Linux Host skype (or other background tool) brings a message on top of the guest, after which getting/retaining the keyboard focus in the guest is never consistent. In each case a combo of switching in/out of the window using the host-key and/or stimulating mouse and key actions in/out of the guest during the switches resolves it eventually, but never consistently. Notably, when I return to the guest, I get one successful keypress most of the time, and then no more functioning keyboard (mouse is always fine). This has been the case for as long as I can remember (certainly the 2.1+ virtualbox non-ose under Ubunutu intrepid and jaunty).
Literally sometimes I type short email messages one character at a time in my XP host by vbox-Host-Key, compiz-window-switch out of VBox, then back to VBox, type one key and repeat; Until my one line message is typed. People with Skype on Linux must really be annoyed by this.. moreso than the blackberry usb filter issues I imagine (number 2 on my wishlist).
Let me know how I can help
comment:5 by , 15 years ago
After switching to VirtualBox 3.0, it appears that guest control keyboard issues are not directly related to vbox, but likely a more benign symptom of various gnome apps stealing keyboard focus intermittently (like skype). In terms of recovery of the keyboard, I have noticed that when it does "go" or not take the focus back to the guest on mouse click, that the little green arrow in the keyboard capture indicator light is also not green. Clicking on the titlebar at this point seems to be the only consistent way to get the focus back into the guest (and change the little capture indicator back to green). In fullscreen I have not found a solution without coming out of fullscreen to rectify.
comment:6 by , 15 years ago
For me the problem is that I lose everything in the host.
Running VB 3.0.6 on Ubuntu Karmic Koala (was running Jaunty, but upgraded it to see if it would fix the problem) with a Windows XP Guest.
I also suffer from the bug that won't allow me to set/change the HostKey (currently it's set to right win, but RightWin+F doesn't give me Fullscreen (Host+F) but a search box, so the Virtualbox SW is clearly not getting the keypress (although the guest is).
I wasn't able to use my trackpad in the host until I inserted a USB Mouse.
If I shut down the VB, the host system has full access to the mouse/trackpad and keyboard.
It was all perfectly after the install. And even after I installed the Guest Additions (which I've uninstalled and reinstalled to try and fix the problem). Inserting an USB keyboard also allows me to use the host, but clearly this is not idea for a laptop user to have to carry a mouse and keyboard (or shutdown the guest when attempting to use the host).
follow-ups: 8 9 comment:7 by , 14 years ago
It looks like a lot of people commenting on the bug aren't really experiencing it. The problem is that, after being in the VM for a bit, when you switch back to the guest OS the Alt key is considered depressed by all of the host software until I press it myself to free it. I can't say that it happens all of the time, but it happens the majority of the time to me. It has occurred to me on the following machines:
- a Lenovo x61T laptop (Santa Rosa chipset, 1.8Ghz Core2Duo L7700, 8GB of Ram, no USB devices other than the internal bluetooth and fingerprint reader, none of which are passed on to the guestOS) running Windows 7 Ultimate x64 at 1024x768 res using VirtualBox 3.1.0 and 3.1.2-56127 with a Windows XP SP3 guest.
- a desktop (Core2Quad Q6600, Foxconn BlackOps X48 motherboard, 4Gb of DDR3 2000 ram running at 1066, USB mouse, PS2 keyboard, various other USB peripherals) running Windows 7 Ultimate x64 at 1280x1024 res using VirtualBox 3.1.2-56127 with a Windows XP SP3 guest.
In both cases my host key is set to Scroll Lock, and both VMs were upgraded from prior versions (although Virtualbox was a fresh install on the desktop and an uninstall/install upgrade on the laptop).
I shall try to find more information about what triggers the issue, but please do investigate. For anyone who switches between the host and guest OSes a lot, this bug is pretty obnoxious. I've accidentally sent emails, closed unsaved documents, etc because VirtualBox makes the host OS think that I'm holding down the Alt key when I switch out. Even when I haven't used the Right Alt key in the VM.
comment:8 by , 14 years ago
Coorection of previous comment:
It looks like a lot of people commenting on the bug aren't really experiencing it. The problem is that, after being in the VM for a bit, when you switch back to the host OS the Alt key is considered depressed by all of the host software until I press it myself to free it.
follow-up: 10 comment:9 by , 14 years ago
Replying to NGrey:
The problem is that, after being in the VM for a bit, when you switch back to the guest OS the Alt key is considered depressed by all of the host software until I press it myself to free it.
I found that pressing Left-Alt will NOT get the Alt key to be considered released, but pressing Right-Alt in the guest OS will. Moreover, I found this problem in the guest OS, I don't think I saw it in the host OS.
My system: Dell desktop running Ubuntu 9.10 (kernel 2.6.31), VirtualBox 3.1.4 r57640 with a Windows XP guest.
comment:10 by , 14 years ago
Replying to RobertB:
Replying to NGrey:
The problem is that, after being in the VM for a bit, when you switch back to the guest OS the Alt key is considered depressed by all of the host software until I press it myself to free it.
I found that pressing Left-Alt will NOT get the Alt key to be considered released, but pressing Right-Alt in the guest OS will. Moreover, I found this problem in the guest OS, I don't think I saw it in the host OS.
My system: Dell desktop running Ubuntu 9.10 (kernel 2.6.31), VirtualBox 3.1.4 r57640 with a Windows XP guest.
Further investigation has shown that both the right and left ALT keys can get stuck. The odd thing is that none of the other modifier keys appear to get stuck when transitioning from the guest to the host.
Also, if you're encountering a situation where the Alt key is depressed upon entering the guest OS, you should probably open a new bug, as this one is leaving the guest and returning to the host. Although you should definitely link it to this one.
comment:11 by , 14 years ago
ALT key getting stuck in my host after being in VBox guest.
I'm using VBox 3.1.6 with Guest Additions, Windows 7 guest, host is Dell desktop running Window XP SP3.
For clarity: HOST is where my ALT key gets stuck, after leaving Guest.
I didn't figure out any magical key combination to get unstuck, and have had to restart my host. Pressing Alt again did not fix it (nor trying lots of other things, including sliding mouse in and/or out of guest with Alt still pressed). Happened a few times in the last couple of days.
For me this bug is worse than obnoxious.
If a suggestion above helps me get unstuck without having to reboot I will post again.
comment:12 by , 14 years ago
Time to revive this one. The issue is pretty simple once you understand it. Reproduction for Windows: (I'm using 7, but I'm assuming anything from XP and up will work.)
- Open the On-Srceen Keyboard under Accessories>Ease of Access. (This is not needed to reproduce the bug, but helps visualize what's going on. Please use your physical keyboard rather than the OSK for the instructions below.)
- Alt+tab to a running VirtualBox machine using only the keys alt and tab. Note that alt does not get stuck when doing this.
- Alt+tab to a running VirtualBox machine and switch to the VB window by clicking on the thumbnail or, indeed, the window itself. At this point, the alt key is stuck.
It's important to note what happens at this point. You may press and release the alt key for as many times as you wish when the VM is focused - the VM silently eats those key presses and the OS still thinks the key is pressed. It's not until the VM loses focus that you can actually feel the effects of this bug, which may lead you to (incorrectly) assume that the bug actually doesn't "happen" until the focus capture is released from the VM.
It should be noted that this bug is not limited to alt, but affects left ctrl, and the logo ("win") key as well. For these keys (as well as alt, of course) it can be reproduced this way:
- Focus any application except VB. (The task bar will do, for example.)
- Press and hold your desired modifier key.
- Give VB focus by using the mouse. (Prerably also capturing input focus.)
- Release your modifier.
- Optionally, do anything you want inside the VM to convince yourself that these key presses don't affect the outside world.
- Press right ctrl (or whatever your host key is) to release capture from the VM.
- Now, that key will still be stuck from the OS's point of view.
Some specifics:
- This can be done both for left and right ctrl, even when right ctrl = host. However, OSK's monitoring of the key is incorrect, so the ctrl key can be shown in OSK as released even when it isn't and vice versa. (This is a bug in OSK that can be triggered independently of the VB bug, by holding one ctrl key and pressing and releasing the other.)
- In the case of alt, it seems that it's only captured on the OS level and doesn't affect the menu accelerators or keyboard shortcuts in applications. It only affects e.g. the ctrl+tab shortcut in Web browsers and other tabbed applications, which will instead be interpreted as ctrl+alt+tab, which is a feature that works like alt+tab, except that it will not switch over focus to the selected application when ctrl and alt are released, but allows you to browse the active applications with tab or arrow keys and then press enter. This is a useful feature when used on its own, but I digress.
- When doing the same procedure with alt gr, (and don't touch any other modifiers while the VM is has capture focus) host applications will think that ctrl+shift is pressed, so you could for example press just the J or M key to insert a line break or I to insert a tab. (Same as ctrl+shift+m/j/l which is analogous to the ctrl+m/j/l control characters in a UNIX terminal, but once again, I digress.)
Lastly I should add that you can typically kill the stuck key simple by pressing and releasing it once.
Hoperfully this long text will shed some light on the issue, and I'm hoping that someone will have a look at it now that it is (hopefully) fully understood.
comment:13 by , 14 years ago
maybe the wrong place to ask, but how do I unsubscribe from this ticket? it's not relevant for me.
comment:14 by , 13 years ago
This bug also affects me on an Arch Linux x86_64 host (WinXP guest). So from everyone's comments, it occurs across multiple guests and hosts. DidrikM's comments seem pretty helpful in reproducing it.
Could we get someone to release all modifier keys (L/R Alt, L/R Ctrl, Shift, Win/Super, AltGr) in the host once the guest receives focus? It may not be a complete fix for the bug but it would be an usable workaround. Either that or wait for the keys to be released before grabbing focus.
@spbrereton: I don't believe any of us who are actively updating have permissions to change the CC list for the ticket, and Trac software doesn't have an easy way for users to manage their own subscriptions. We'll have to wait for someone at Oracle to pay attention, which doesn't seem very likely given that they've ignored this bug for over two years in multiple tickets.
comment:15 by , 12 years ago
Since I don't seem to have the possibility to CC myself to this ticket, I need to add this comment to express that I'm also regularily affected by this bug: the host's Ctrl key gets stuck. However, I have not been able to reproduce the bug as described in comment:12.
I am using Windows 7 64-bit both as guest and host and (still) VB 4.1.8, will upgrade to 4.1.18 now.
comment:16 by , 12 years ago
I am currently being affected by the problem. I'm running VirtualBox 4.1.20r80170 on a Windows7 64bit Host. Using a Ubuntu 10.04 guest, I get the Alt key stuck when moving from the Guest OS back to the Host. As described in comment 12, pressing of the Left Alt key 2 times removes the problem. I'm also finding the mouse scroll wheel not working in the Guest OS, but when I move back to the Host OS, press the Alt key 2 times and move mouse back to Guest OS, the scroll wheel works again.
I'm also running VirtualWin v4.3 to provide multiple desktops on the Host OS, with Ctrl-Alt-<arrow keys> mapped to provide desktop switching. When I use Ctrl-Alt-<right arrow> to switch desktops, when the VirtualBox window appears, it takes focus and the Ctrl-Alt-<arrow> events are handled by the Guest OS, and I have to select another Host OS window to get desktop switching via hotkeys to work again. Maybe this is having an affect on the release of the Alt key.
comment:17 by , 12 years ago
To get unstuck:
Press both Ctrl, both Shift and both Alt keys at the same time and release them all at roughly the same time.
Should work. If it does not get unstuck try again.
That's the trick for unstucking Alt key in Windows that my friend taught me around 15 years ago. Funny it's still useful.
comment:18 by , 11 years ago
I can confirm this problem. Currently using virtualbox 4.1.22. Running a linux guest with a windows 7 64-bit host. I have had this problem for a long time. I cannot unstuck inside guest window. Clicking on something windows (like desktop background or task bar) and hitting alt unstucks the key.
comment:19 by , 11 years ago
I run
- Host:Windows 7 64-bit
- Guest: Ubuntu LTS
I notice this problem most because I use VirtuaWin. I press Alt+Ctrl+g
to go to desktop 1 (and Alt+Ctrl+v
to go to desktop 4 where my guest is running). I press Alt+Ctrl+Super+g
to move an application to desktop 1. All this works as designed unless I am using the guest. Of course, I first press the Host
key, then I press Alt+Ctrl+g
to go to desktop 1 and read e-mail or something, but the effect is sending the guest to desktop 1...sometimes. That means that the super
key is stuck. Otherwise, I press the host key then try to access the start menu (perhaps to open PowerShell
) and when I press the super
key, nothing happens. I've found that when this is the case, Alt
is the most common culprit.
In either case, I tap the stuck key (which I guess appropriately sends the key-up event to Windows), then I can proceed as usual.
comment:20 by , 11 years ago
Description: | modified (diff) |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Summary: | ALT key state not reset when leaving guest → ALT key state not reset when leaving guest -> duplicate of #2613 |
I will close this as a duplicate of #2613. Please re-open if you disagree.
comment:21 by , 11 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
comment:22 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Summary: | ALT key state not reset when leaving guest -> duplicate of #2613 → ALT key state not reset when leaving guest -> fixed as of VirtualBox 4.2.14 |
Bug #2613 was for Linux hosts, not Windows hosts.
comment:23 by , 10 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I am still getting this problem. Not all the time but sometimes. Changing to the VM and away sometimes fixes it but not always. Weird things is that the alt-gr key works fine in the VM itself, but in programs on the host it does not. SOme programs ont he host do not enter a key at all and some enter the key as if the alt-gr had not been pressed.
Running Virtual Box 4.3.10 on a Windows 8.1 host with CentOS (64 bit) guest. I run the guest as a headless server.
Very annoying since I am mainly developing PHP and on my keyboard $ is on an alt-gr combination. Can get to the alt-gr keys using ctrl+alt instead but it's very annoying. I don't understand why this has been classed as fixed so often only to be reopened.
comment:24 by , 10 years ago
adamc, I think the following build should fix the issue:
https://www.virtualbox.org/download/testcase/VirtualBox-4.3.13-93995-Win.exe
If you would like to give it a try please let me know if it does.
comment:25 by , 10 years ago
Still getting this problem with 4.3.14_RC1-94905: host = Win7 64 bit, guest = Ubuntu 14.04 LTS.
The problem doesn't appear immediately after booting up the guest but after some time. Found two workarounds:
- press host-key twice (AltGr works again for some time)
- disable host-key completely (the problem seems to not appear at all)
Let me know if you need more information.
comment:26 by , 10 years ago
I'm using the most recent version (4.3.14-95030-Win) on a Windows XP SP3 host with various guest Windows systems inside it (XP, Win7, WS2008R2, etc.) and i never experienced any problems with AltGR with previous versions, but, after this update the button isn't working at all, in any of the Windows guests - which is pretty much annoying, when trying to type backslahes for example, into command prompts.
Note: My host-key is set to left control button atm..
comment:27 by , 10 years ago
- Virtualbox 4.3.14 r95030
- Host - Windows 8.1 64bit
- Guest - Ubuntu 14.04 64bit
Whenever I switch from guest to host and back then AltGr is not working. When I press right Ctrl once then AltGr starts working in guest, but then Alt+Tab doesn't switch windows inside guest but instead in host. Alternate characters key in Ubuntu guest is set to "Right Alt".
comment:28 by , 10 years ago
Same Problem here:
- Virtualbox 4.3.14 r95030
- Host - Windows 8.1 Pro 64bit
- Guest - Ubuntu 14.04 LTS 64bit
Whenever I switch from guest to host and back then AltGr is not working. When I press right Ctrl once then AltGr starts working in guest, but then Alt+Tab doesn't switch windows inside guest but instead in host. Alternate characters key in Ubuntu guest is set to "Right Alt".
I copied my virtual machine from another host running on Win7 Pro, where this problem never appeared. Running the same virtual machine under the mentioned win 8 pro host results in the described problem.
comment:29 by , 10 years ago
This fix caused a regression for certain users (mainly but not only people running Windows 8.1 as a host system) whereby AltGr stopped being recognised in virtual machines. A user created a separate bug ticket for this<1>, which some of you are already aware of. This ticket has a link to a test build which should fix the problem in one of the comments.
I would appreciate people trying out the test build. I am interested to know whether AltGr works for you in the four combinations of with the 4.3.14 release and with the test build, respectively with keyboard capturing enabled and disabled. Disabled is what happens when you press the host key (usually right Control) and Alt-Tab changes to switch host windows instead of guest ones.
comment:30 by , 10 years ago
VirtualBox-4.3.15-95141-Win.exe
This version fixed the behavior I described for me.
comment:32 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:33 by , 8 years ago
I am experiencing something very like this, or identical. My host is Win7Pro & guest is WinXP. VM Virtual Box ver. 5.0.20 r 106931. I only just red the above, so have not attempted any of the fixes or permutations thereof, but wanted to post promptly in case the problem is being noticed by folks again. I don't recall when it began, but I am pretty sure it was with the last version or so. I don't think I had the problem with 5.0.14 and earlier, but that is a bit of a guess. I plan to post again if an above solution or approximation thereof works.
Could you please FINALLY look deeper into the problem. This has been going on for a year.
http://www.virtualbox.org/ticket/784
http://www.virtualbox.org/ticket/2410
http://www.virtualbox.org/ticket/2537
http://www.virtualbox.org/ticket/2412