Ticket #6488 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

Mouse wheel scrolling interpredted as click events in guest -> fixed after the 3.1.6 release

Reported by: mwisnicki Owned by:
Priority: major Component: other
Version: VirtualBox 3.1.6 Keywords:
Cc: Guest type: BSD
Host type: Windows


Host: Windows 7 x64
Guest: FreeBSD 8.0/i386, no additions, xorg-7.4, xorg-server-1.6.5

Scrolling down is fine however scrolling up generates additional clicks.

In xev scroll-up generates following events with same timestamp:

  1. ButtonPress(button=8)
  2. ButtonPress(button=9)
  3. ButtonPress(button=4)
  4. ButtonRelease(button=4)

Obviously first two events make no sense.

Mouse is a simple 2-button usb mouse with scroll which works fine in FreeBSD as a host.

Attachments Download (21.6 KB) - added by mwisnicki 5 years ago.
Log files

Change History

comment:1 Changed 6 years ago by mwisnicki

Just installed virtualbox additions from ports:


and enabled vboxvideo + vboxmouse

It seems to still happen but somewhat more randomly, every 1 to ~10 moves of scroll invalid events are injected.

I have noticed that buttons 8 and 9 are sometimes reported as released. Also, infrequently instead of button=4 I get button=5 (down).

comment:2 Changed 6 years ago by mwisnicki

Seems like that 4 instead of 5 was caused by my shitty mouse.

Now with good mouse it looks like Pressed(8+9) happens always when I move scroll-up but previous event was not Pressed(4). After scrolling up any event different than Pressed(4) will cause Released(8+9).

Basically it is as if buttons 8+9 marked beginning and end of scrolling up.

comment:3 Changed 6 years ago by michael

Taking a look at the source code of the FreeBSD mouse driver, it looks to me like it resends the sequence for switching the mouse to IntelliMouse mode after it has already switched it to Explorer mode, as a hack to fool certain  KVM switches. I assume that a real MS Explorer mouse would ignore this if it were already in Explorer mode, but our code looks like it will really switch back. You might want to try the following test build from the stable branch ( disclaimer here) which contains a change which should address this issue:

comment:4 Changed 5 years ago by michael

Any news? Did you get a chance to try out the updated version?

comment:5 Changed 5 years ago by mwisnicki

Yes, sorry for delay. Unfortunately it didn't help.

I have found however that if I stop moused then Xorg's mouse_drv will happily use /dev/psm0 directly instead of /dev/sysmouse and everything will work correct.

Then, if I stop X and start moused again, it will no longer report those extra buttons while scrolling.

comment:6 Changed 5 years ago by michael

Would you be able to get a bit of logging for me? If you run the following VBoxManage commands (VBoxManage is a command line tool which comes with VirtualBox):

VBoxManage setextradata "<VM name>" "VBoxInternal/Devices/pckbd/0/Config/R0Enabled" "0"
VBoxManage setextradata "<VM name>" "VBoxInternal/Devices/pckbd/0/Config/GCEnabled" "0"

and then start VirtualBox with the environment variables set (those are "L"s, not "1"s):


set, it will produce logging for most mouse events inside the VM. It would be great if you could create log files for when you see this issue, and for when you do not. If it is difficult to do separate runs in which the error occurs and in which it doesn't, then note the time (as seen by your host system) as of when the log data represents the problem occurring or not.

Changed 5 years ago by mwisnicki

Log files

comment:7 Changed 5 years ago by mwisnicki

Hope that's helpful.

As you said, FreeBSD does IMPS/2->IMEX->IMPS/2 but Xorg's own driver switches it correctly IMPS/2->IMEX.

BTW How should I restore default values of {R0,GC}Enabled, set them to 1 ?

comment:8 Changed 5 years ago by michael

Set them to "". I will comment further after I have checked the logs.

comment:9 Changed 5 years ago by michael

Sorry, I gave you a link to the wrong revision. Please try (same disclaimer...).

comment:10 Changed 5 years ago by mwisnicki

I works great now. Thanks!

comment:11 Changed 5 years ago by michael

  • Summary changed from Mouse wheel scrolling interpredted as click events in guest to Mouse wheel scrolling interpredted as click events in guest -> fixed after the 3.1.6 release

Thanks for the feedback.

comment:12 Changed 5 years ago by frank

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

Fixed in 3.1.8

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use