How to stop keys from repeating when typing
-
David P. Caldwell
- Posts: 9
- Joined: 16. Oct 2013, 19:51
Re: How to stop keys from repeating when typing
Sorry; as for the forum error, I got errors twice when attempting to attach the file and when I returned to the page, determined to post my message without the file, I posted it and the file I had earlier attempted to attach somehow got attached (which I only discovered when visiting the forum). Anyway, ...
I am attempting to install the i386 FreeBSD to see if I can reproduce the keyboard problem; if I can, I'll try the USB fix and see what happens and report back.
-- David P. Caldwell.
I am attempting to install the i386 FreeBSD to see if I can reproduce the keyboard problem; if I can, I'll try the USB fix and see what happens and report back.
-- David P. Caldwell.
-
David P. Caldwell
- Posts: 9
- Joined: 16. Oct 2013, 19:51
Re: How to stop keys from repeating when typing
OK, I tried with i386 FreeBSD with both ps2 and usb keyboard emulation.
I did seem to notice a difference. The usb emulation did less repeating but more getting the keys out of order. So when I'd type the word "function" quickly I'd get a few letters scrambled.
Thus far I still can't figure out why this problem is very easy to manifest in NetBeans but hard and/or impossible to get to manifest elsewhere. I do my fastest typing in my IDE, which may be part of the problem. But I'm not really seeing this at the command line (i.e., a terminal program running inside KDE, not the "real" command line), for example. I can't figure out whether that's *just* typing speed, or application-specific, or what. I haven't tested a wide variety of application programs yet.
Attaching new vbox.log in case it's helpful.
-- David P. Caldwell.
I did seem to notice a difference. The usb emulation did less repeating but more getting the keys out of order. So when I'd type the word "function" quickly I'd get a few letters scrambled.
Thus far I still can't figure out why this problem is very easy to manifest in NetBeans but hard and/or impossible to get to manifest elsewhere. I do my fastest typing in my IDE, which may be part of the problem. But I'm not really seeing this at the command line (i.e., a terminal program running inside KDE, not the "real" command line), for example. I can't figure out whether that's *just* typing speed, or application-specific, or what. I haven't tested a wide variety of application programs yet.
Attaching new vbox.log in case it's helpful.
-- David P. Caldwell.
- Attachments
-
VBox.log- (54.66 KiB) Downloaded 63 times
-
michaln
- Oracle Corporation
- Posts: 2973
- Joined: 19. Dec 2007, 15:45
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Any and all
- Contact:
Re: How to stop keys from repeating when typing
Okay, that suggests that the guest OS for whatever reason isn't processing the keyboard input quickly enough. If the keystroke order is getting swapped, that probably means multiple keys were sent in the same report (and there is no specified order in the spec, unfortunately). Normally that doesn't happen because the guest OS "pulls" the input from the USB keyboard faster than you can type.David P. Caldwell wrote:I did seem to notice a difference. The usb emulation did less repeating but more getting the keys out of order. So when I'd type the word "function" quickly I'd get a few letters scrambled.
I imagine NetBeans makes things worse by being a resource hog, but there must be something else going on as well. With the PS/2 keyboard emulation, there is a defined order and everything is queued bit by bit, so a somewhat busy guest OS shouldn't cause trouble. And your host should be rather fast.
Any chance you could provide a VM for testing?
-
David P. Caldwell
- Posts: 9
- Joined: 16. Oct 2013, 19:51
Re: How to stop keys from repeating when typing
I would be happy to provide a VM for testing; how would I do that?
-- David P. Caldwell.
-- David P. Caldwell.
-
michaln
- Oracle Corporation
- Posts: 2973
- Joined: 19. Dec 2007, 15:45
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Any and all
- Contact:
Re: How to stop keys from repeating when typing
Hmm, I just found out that the official Oracle system is in transition right now and not available. Perhaps you could use some public file sharing service? If necessary, you could encrypt the archive and PM me the password.David P. Caldwell wrote:I would be happy to provide a VM for testing; how would I do that?
-
David P. Caldwell
- Posts: 9
- Joined: 16. Oct 2013, 19:51
Re: How to stop keys from repeating when typing
First I'll try to create the archive. What would be the right way to do that? Do I create an "appliance?" Zip up the files that I think matter?michaln wrote:Hmm, I just found out that the official Oracle system is in transition right now and not available. Perhaps you could use some public file sharing service? If necessary, you could encrypt the archive and PM me the password.David P. Caldwell wrote:I would be happy to provide a VM for testing; how would I do that?
-
michaln
- Oracle Corporation
- Posts: 2973
- Joined: 19. Dec 2007, 15:45
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Any and all
- Contact:
Re: How to stop keys from repeating when typing
Create an "appliance", in other words export the VM in OVA format. Zipping up the files works too but is much more error prone.David P. Caldwell wrote:First I'll try to create the archive. What would be the right way to do that? Do I create an "appliance?" Zip up the files that I think matter?
-
Daniel.Glasser
- Posts: 20
- Joined: 12. Nov 2013, 02:08
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux
- Location: Cedar Rapids, IA
Re: How to stop keys from repeating when typing
VirtualBox 4.3.0:
I have been encountering this problem as well. I first saw it on my Intel mac mini (2nd gen, 8gb RAM, core2 duo), then it started happening on my Windows 7 Professional machine at home (6gb RAM, core-2 quad), and just this afternoon, after weeks of having no such problem on my office workstation (Windows 7 Enterprise, Intel Core i5-3570 @ 3.40 GHz) it just started, I can't get it to stop happening; power-cycling the host computer has no effect; shortly after I log into my guest OS (Ubuntu 13.04 x86_64, in this case), it starts happening; most often when I'm in emacs.
The symptom I have is that the last key keeps repeating itself, and once it starts, it does not stop. Hitting a meta key sometimes stops the current character from appearing, but the next character generating key I type repeats endlessly. I ended up "pulling the plug" because I was editing a critical file and I could not get out of the editor because I had no control over what was coming from the keyboard. The GUI in the guest could not handle the stream of characters. I have found that setting the repeat rate in the Windows control panel to its slowest and with the longest delay has caused no change in the behavior that I can detect.
Can say that every guest it's happened to me on has been Ubuntu 10.04, x86_64. I can also say that this does not happen with VMWare Player (though I'm not using the same VM files) or Parallels Desktop 8 (I only have that on my Mac).
I will attach the log file from my work machine now, and when I'm home, see if I can pull the logs from the other two machines. I cannot send the VM from work; I'll export the other two VMs and send them along if I can.
I have been encountering this problem as well. I first saw it on my Intel mac mini (2nd gen, 8gb RAM, core2 duo), then it started happening on my Windows 7 Professional machine at home (6gb RAM, core-2 quad), and just this afternoon, after weeks of having no such problem on my office workstation (Windows 7 Enterprise, Intel Core i5-3570 @ 3.40 GHz) it just started, I can't get it to stop happening; power-cycling the host computer has no effect; shortly after I log into my guest OS (Ubuntu 13.04 x86_64, in this case), it starts happening; most often when I'm in emacs.
The symptom I have is that the last key keeps repeating itself, and once it starts, it does not stop. Hitting a meta key sometimes stops the current character from appearing, but the next character generating key I type repeats endlessly. I ended up "pulling the plug" because I was editing a critical file and I could not get out of the editor because I had no control over what was coming from the keyboard. The GUI in the guest could not handle the stream of characters. I have found that setting the repeat rate in the Windows control panel to its slowest and with the longest delay has caused no change in the behavior that I can detect.
Can say that every guest it's happened to me on has been Ubuntu 10.04, x86_64. I can also say that this does not happen with VMWare Player (though I'm not using the same VM files) or Parallels Desktop 8 (I only have that on my Mac).
I will attach the log file from my work machine now, and when I'm home, see if I can pull the logs from the other two machines. I cannot send the VM from work; I'll export the other two VMs and send them along if I can.
- Attachments
-
- VBox.zip
- Host: Windows 7 Enterprise 64bit, Service Pack 1, 3.4GHz, 8GB RAM, Intel(R) Core(TM) i5-3570, guest Ubuntu 13.04 x86_64 desktop
- (24.45 KiB) Downloaded 40 times
----
Daniel A. Glasser
Annoying the Internet, and before that, the Usenet, since 1981
Daniel A. Glasser
Annoying the Internet, and before that, the Usenet, since 1981
"Kids these days don't know how good they've got it!
Back when I was a young whippersnapper, we used to carve our bits out of Ivory soap, and if we flushed our buffers too often, the septic system backed up!"
-
michaln
- Oracle Corporation
- Posts: 2973
- Joined: 19. Dec 2007, 15:45
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Any and all
- Contact:
Re: How to stop keys from repeating when typing
So what changed? It sounds like it wasn't VirtualBox...Daniel.Glasser wrote:I have been encountering this problem as well. I first saw it on my Intel mac mini (2nd gen, 8gb RAM, core2 duo), then it started happening on my Windows 7 Professional machine at home (6gb RAM, core-2 quad), and just this afternoon, after weeks of having no such problem on my office workstation (Windows 7 Enterprise, Intel Core i5-3570 @ 3.40 GHz) it just started, I can't get it to stop happening; power-cycling the host computer has no effect; shortly after I log into my guest OS (Ubuntu 13.04 x86_64, in this case), it starts happening; most often when I'm in emacs.
-
Daniel.Glasser
- Posts: 20
- Joined: 12. Nov 2013, 02:08
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux
- Location: Cedar Rapids, IA
Re: How to stop keys from repeating when typing
Sorry, if I knew that, I wouldn't be so frustrated.So what changed? It sounds like it wasn't VirtualBox...
The Mac I have at home started doing it within hours of installation. The PC at home was just fine until it wasn't. When it first happened, I was in emacs in the guest, editing an Apache configuration file. I may have restarted apache2 shortly before it started. As for the system in my office, I'd been using it all day to do (and redo) cross-toolchain builds and "release" builds. I am using sparse virtual HDs; don't know if that tells us anything or not. One of the virtual HDs became full earlier, but I don't see how that could have affected this. I do know that once it starts, it affects everything on the "desktop". The guest desktop GUI is not designed to cope with characters being typed while I'm trying to make menu selections, so the menus go away or the wrong thing gets selected. Trying to exit emacs (which insists on an answer to "do you really want to leave this modified buffer unsaved", twice, before it will exit, and it's hard to type "ps" then a "kill command when what the terminal window sees from the console keyboard is
When I think about it, each time this has first appeared, it has happened while I have at least one emacs session open on the guest, and I have the clip board shared bidirectionally. The host auto-repeat seems not to affect the auto-repeat in the guest on Windows -- I was unable to get to the VMs at home last night because of family duties and having to sleep. (I know this is the Mac discussion.)nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnkkkkkkkkiiiiiiiiillllllllllllllllll --------99999999 11111111000000000022223333333333333333333333333333\n\n\n\n\...
Is there anything that might affect the delivery of the make/break codes from the host into the guest in the hypervisor? I'm not sure which mechanism Virtualbox uses for getting the keyboard events on the host.
----
Daniel A. Glasser
Annoying the Internet, and before that, the Usenet, since 1981
Daniel A. Glasser
Annoying the Internet, and before that, the Usenet, since 1981
"Kids these days don't know how good they've got it!
Back when I was a young whippersnapper, we used to carve our bits out of Ivory soap, and if we flushed our buffers too often, the septic system backed up!"
-
michaln
- Oracle Corporation
- Posts: 2973
- Joined: 19. Dec 2007, 15:45
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Any and all
- Contact:
Re: How to stop keys from repeating when typing
Well, I was just hoping. We've never seen the problem, no one can tell us how to reproduce it, so of course it's not getting fixed.Daniel.Glasser wrote:Sorry, if I knew that, I wouldn't be so frustrated.
I don't think that's relevant, or I can't imagine how it could be.I am using sparse virtual HDs; don't know if that tells us anything or not. One of the virtual HDs became full earlier, but I don't see how that could have affected this.
Hmm. Has anyone seen this in a VM without Guest Additions installed? The clipboard could theoretically cause trouble.When I think about it, each time this has first appeared, it has happened while I have at least one emacs session open on the guest, and I have the clip board shared bidirectionally.
That is correct, the guest controls the repeat rate.The host auto-repeat seems not to affect the auto-repeat in the guest on Windows -- I was unable to get to the VMs at home last night because of family duties and having to sleep. (I know this is the Mac discussion.)
The key events could in theory be getting lost, but a) there are deep enough queues that this is really unlikely to happen, and b) based on what you say, it's not that keys are randomly lost, the problem is that the guest sees every key down event but ignores every key up, right?Is there anything that might affect the delivery of the make/break codes from the host into the guest in the hypervisor? I'm not sure which mechanism Virtualbox uses for getting the keyboard events on the host.
Next time this happens, please take a snapshot of the running VM or save the state. Once you restore the state/snapshot, does the problem persist? If yes, we'd have something to analyze, if not, you'd have a workaround (and we one more data point).
-
Daniel.Glasser
- Posts: 20
- Joined: 12. Nov 2013, 02:08
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux
- Location: Cedar Rapids, IA
New information
When this is happening, I can close the guest, saving its state. When I restored the session, it picks up where it left off, with the stuck keys and all. I saved it again, started it back up again, but this time immediately used the mouse to select the terminal window, which proceeded to get the characters. I hit a few more keys, the repeat stopped, and while it was "in neutral", I went into the Ubuntu system settings dialog and turned off auto-repeat. This changed the behavior somewhat; it started missing one out of every few characters I typed into "terminal". While I was poking at it, a Windows dialog came up and told me the Virtualbox application had encountered an error and would be shut down; my session went away at that point.
What this tells me is that it is either in the guest, or some state information maintained in the checkpoint (save) file.
I'm thinking that the way in which the keyboard gets used when I'm in emacs might have something to do with how this problem gets triggered; I tend to rest my left little finger on the "control" key when I'm navigating around the file. Another thing I've noticed is that I sometimes get an underscore when I type a space right after a shifted character; it's possible that the shift has not yet broken at that point. This happens to me most often when typing a comment, for example with the text "/* something....", the "_" shows up between the '*' and the 's'. This happens regularly, and might be related.
I cannot send you a save file and VM from work, but if I can reproduce this at home with a VM that doesn't have proprietary and confidential property from my employer, I will wrap that one up and send it to you (if I can make it fit; the HD images might make it too big to attach in the forum).
I hope this additional information is helpful. If there are any debugging options you want me to try with the command line tool on the host, let me know.
Thanks,
Daniel Glasser
Senior* Software Engineer
Some corporation in the midwest (not allowed to show my company affiliation in these contexts)
* more like "ancient", but my employer doesn't have that position listed in the salary bands.
What this tells me is that it is either in the guest, or some state information maintained in the checkpoint (save) file.
I'm thinking that the way in which the keyboard gets used when I'm in emacs might have something to do with how this problem gets triggered; I tend to rest my left little finger on the "control" key when I'm navigating around the file. Another thing I've noticed is that I sometimes get an underscore when I type a space right after a shifted character; it's possible that the shift has not yet broken at that point. This happens to me most often when typing a comment, for example with the text "/* something....", the "_" shows up between the '*' and the 's'. This happens regularly, and might be related.
I cannot send you a save file and VM from work, but if I can reproduce this at home with a VM that doesn't have proprietary and confidential property from my employer, I will wrap that one up and send it to you (if I can make it fit; the HD images might make it too big to attach in the forum).
I hope this additional information is helpful. If there are any debugging options you want me to try with the command line tool on the host, let me know.
Thanks,
Daniel Glasser
Senior* Software Engineer
Some corporation in the midwest (not allowed to show my company affiliation in these contexts)
* more like "ancient", but my employer doesn't have that position listed in the salary bands.
----
Daniel A. Glasser
Annoying the Internet, and before that, the Usenet, since 1981
Daniel A. Glasser
Annoying the Internet, and before that, the Usenet, since 1981
"Kids these days don't know how good they've got it!
Back when I was a young whippersnapper, we used to carve our bits out of Ivory soap, and if we flushed our buffers too often, the septic system backed up!"
-
michaln
- Oracle Corporation
- Posts: 2973
- Joined: 19. Dec 2007, 15:45
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Any and all
- Contact:
Re: New information
I don't suppose you have the corresponding minidump? If you do, it would deserve its own ticket on the public bug tracker...Daniel.Glasser wrote:While I was poking at it, a Windows dialog came up and told me the Virtualbox application had encountered an error and would be shut down; my session went away at that point.
Yes. It sounds like the guest OS is responsible for the repeat.What this tells me is that it is either in the guest, or some state information maintained in the checkpoint (save) file.
I still don't know what to make of it. But more and more it looks like the guest OS gets confused somehow. Unfortunately I don't know a lot about how Ubuntu handles keys, so I don't know how to debug this on the guest side.I'm thinking that the way in which the keyboard gets used when I'm in emacs might have something to do with how this problem gets triggered; I tend to rest my left little finger on the "control" key when I'm navigating around the file. Another thing I've noticed is that I sometimes get an underscore when I type a space right after a shifted character; it's possible that the shift has not yet broken at that point. This happens to me most often when typing a comment, for example with the text "/* something....", the "_" shows up between the '*' and the 's'. This happens regularly, and might be related.
The forum won't work (definitely too big), but we'll figure something out.I cannot send you a save file and VM from work, but if I can reproduce this at home with a VM that doesn't have proprietary and confidential property from my employer, I will wrap that one up and send it to you (if I can make it fit; the HD images might make it too big to attach in the forum).
Yes, it's definitely helpful. There are a few things you can try. The VBoxManage controlvm <VM> keyboardputscancode <xxx> command can be used to send scan codes to the VM and simulate keyboard input. If you could find how to trigger the key repeat this way, that would be most excellent, but maybe there's more to it.I hope this additional information is helpful. If there are any debugging options you want me to try with the command line tool on the host, let me know.
Another thing you could try is setting the VBOX_GUI_DBG_ENABLED env var or running 'VirtualBox --dbg --startvm <VM>' to start your VM (see VirtualBox --help, unless you're on Windows host in which case you'd have to redirect stdout to a file). From the Debug menu you can then bring up the debug console ("command line") and use the 'info ps2k' command to check the state of the emulated keyboard. If the emulated keyboard is causing the keys to repeat, it will say "Active typematic key xx". If on the other hand the input queue is empty, there's no active typematic key, and the keys are still repeating in the guest, it's definitely the guest causing the repeats.
-
Daniel.Glasser
- Posts: 20
- Joined: 12. Nov 2013, 02:08
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux
- Location: Cedar Rapids, IA
Output from "info ps2k"
With "k" typing itself continuously, here is what I get from the debug console:
I have archived a few ".sav" files, but each (when compressed into a .zip file) is around 1/2GB.
---- Added ----
Using "VBoxManage" to send scans to the VM is similar to typing, other than that it usually gets my break code because it's sent separately. I've been trying to trigger the problem without leaving out key break scancodes in the VBoxManage command line, but have not succeeded so far. If I do, I'll post an update.
---- Another update ----
When typing in the guest, I have now noticed a lot of lost make scans; that is, I type a character, and nothing happens in the terminal (or editor) window I'm working in. It happens with a similar frequency to the lost break codes. It's looking more and more to me that a virtual USB keyboard emulation option would be a good thing to add (if it's not there already, and I've just not found it.)
So this would appear to be something in the guest, but I'm not at all sure what is different about the VM environment than the "iron" environment that would make it do this in Virtual Box, but not on the hardware. Could there be something in the virtual 8041 keyboard interface that Ubuntu is not compatible with? Is it possible to switch Vbox to provide an emulated USB rather than PS2 keyboard?Welcome to the VirtualBox Debugger!
Current VM is 01fd0000, CPU #0
VBoxDbg> info ps2k
PS/2 Keyboard: scan set 2, scanning enabled
Active command 00
LED state 02, Num Lock on
Typematic delay 250ms, repeat period 33ms
Command queue: 0 items (4 max)
Input queue : 0 items (64 max)
VBoxDbg>
I have archived a few ".sav" files, but each (when compressed into a .zip file) is around 1/2GB.
---- Added ----
Using "VBoxManage" to send scans to the VM is similar to typing, other than that it usually gets my break code because it's sent separately. I've been trying to trigger the problem without leaving out key break scancodes in the VBoxManage command line, but have not succeeded so far. If I do, I'll post an update.
---- Another update ----
When typing in the guest, I have now noticed a lot of lost make scans; that is, I type a character, and nothing happens in the terminal (or editor) window I'm working in. It happens with a similar frequency to the lost break codes. It's looking more and more to me that a virtual USB keyboard emulation option would be a good thing to add (if it's not there already, and I've just not found it.)
----
Daniel A. Glasser
Annoying the Internet, and before that, the Usenet, since 1981
Daniel A. Glasser
Annoying the Internet, and before that, the Usenet, since 1981
"Kids these days don't know how good they've got it!
Back when I was a young whippersnapper, we used to carve our bits out of Ivory soap, and if we flushed our buffers too often, the septic system backed up!"
-
michaln
- Oracle Corporation
- Posts: 2973
- Joined: 19. Dec 2007, 15:45
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Any and all
- Contact:
Re: Output from "info ps2k"
I don't know either. I also don't assume that it doesn't happen on any hardware everDaniel.Glasser wrote:So this would appear to be something in the guest, but I'm not at all sure what is different about the VM environment than the "iron" environment that would make it do this in Virtual Box, but not on the hardware.
Yes, it's possible, though I have a hard time imagining what sort of craziness Ubuntu would have to do (then again, if some Linux distro were to do something extra crazy, it would be Ubuntu).Could there be something in the virtual 8041 keyboard interface that Ubuntu is not compatible with?
Yes. 'VBoxManage modifyvm <vmname> --keyboard usb'Is it possible to switch Vbox to provide an emulated USB rather than PS2 keyboard?
And that may not be enough without the corresponding virtual disk, unfortunately...I have archived a few ".sav" files, but each (when compressed into a .zip file) is around 1/2GB.
Interesting. BTW I don't know if you noticed that it's possible to send a larger sequence of scan codes with a single command.Using "VBoxManage" to send scans to the VM is similar to typing, other than that it usually gets my break code because it's sent separately. I've been trying to trigger the problem without leaving out key break scancodes in the VBoxManage command line, but have not succeeded so far. If I do, I'll post an update.
Okay, that sounds like very good evidence that the guest is simply losing keystrokes. When it's a make code, it can be repeated, but when it's a scan code, it causes real trouble.When typing in the guest, I have now noticed a lot of lost make scans; that is, I type a character, and nothing happens in the terminal (or editor) window I'm working in. It happens with a similar frequency to the lost break codes.
Please try the 'showkey' utility in the guest, perhaps 'showkey -s'. It would also be interesting to know whether the same problem with losing keystrokes occurs in X11 and in a full-screen virtual terminal? What I'm trying to find out is whether it's the Linux kernel losing the scan codes or something (much?) higher up the chain.
That's assuming the USB keyboard protocol is better than the PS/2 protocol... which is sadly not true (USB is a step backwards in so many ways it's not even funny). The USB protocol is completely different and the model falls apart unless there is a slow human hand touching the keys. It's certainly worth trying though.It's looking more and more to me that a virtual USB keyboard emulation option would be a good thing to add (if it's not there already, and I've just not found it.)