Hello Frans,
Post by Frans PopPost by Dmitry A. KuminovPost by David BaronThe friendly mouse capture can be done without any untoward tricks, it
seems :-)
Could you please explain how that applies to VirtualBox
Einstein (one of my favorite games ATM :-) automatically captures and
releases the mouse cursor when the "regular" mouse cursor enters/leaves its
window.
This is exactly the same what happens now in VirtualBox once the Guest
Additions are installed onto the guest OS.
Post by Frans PopIt is indeed a quite nice trick which would mean that you'd no longer have
to click the VM to capture the mouse, or to hit the host key to release it.
It would be similar to what's already done for the keyboard with the "auto
capture keyboard" option.
Yep, I think that everybody agrees that it's the most convenient way for
mouse interaction.
The "problem" here is that VirtualBox virtualizes the conventional PS/2
mouse hardware which converts physical mouse movements to series of
sample steps along the X and Y axes counted with the given frequency.
This gives us relative distance measurement ("how many steps the mouse
has made since the last check") on output.
The above means that VirtualBox cannot simply pass absolute {X,Y}
coordinates it gets from the host OS to the virtual mouse because the
mouse simply doesn't know anything about absolute coordinates. Instead,
VirtualBox has to convert absolute coordinates back to relative distance
numbers (calculated as a difference between the current and the previous
absolute coordinate) and pass these numbers to the virtual mouse which
will then report them to the guest OS as the "number of steps".
It should be mentioned that the "step" is not a pixel from the mouse
point of view; it's just a unit which is usually expressed in fractions
of an inch. The guest OS (the mouse driver) can treat these fractions
differently when mapping them to pixel-based mouse pointer movements.
For this reason it's hardly possible to predict by how many pixels the
guest mouse pointer will move after we feed the virtual mouse with the
given number of steps. Or in other words, w/o a special guest mouse
driver that the VirtualBox GUI front-end can talk directly to, it is
impossible to map host pixels to guest pixels when it comes to mouse
movements.
Subsequently, it means that we cannot just stop feeding the guest with
mouse "steps" when the host mouse pointer reaches one of the borders of
the VM window (and then leaves it) as we don't have a guarantee that the
guest mouse pointer has also reached the edge of the virtual display.
The only solution to overcome the above limitation is to virtualize
different mouse hardware that understands absolute positioning, for
example a tablet device. Needless to say that this will require a tablet
support from the guest OS anyway but I can admit that chances are high
even for old OSes like Windows 98. However, developing such a virtual
device is not a one day task and it isn't planned in the near future AFAIK.
Sorry for this maybe too detailed explanation -- I don't know your
technical skills. Anyway, it may be useful for someone else.
--
Regards,
Dmitry A. Kuminov