Hello Huihong, On Thu, 2011-09-01 at 20:56 -0700, Huihong Luo wrote: > I need to know a bit more about the mouse integration. Can someone explain in > big picture on what happened when a mouse pointer is moving from host to the > guest? once the mouse inside the guest window, host informs the guest about > the mouse positions? etc. > > I need to get some ideas on this in order to implement the drag-and-drop > feature for vbox. Right now, it's stuck when the mouse is dragged from host > to vm, how the guest side knows about that. I need to press a key for now to > tell the guest side, so the dnd isn't smooth yet. A good understanding on > mouse integration would be very helpful. > _______________________________________________ vbox-dev mailing list > [email protected] http://vbox.innotek.de/mailman/listinfo/vbox-dev
I'm afraid that this will be a quick-ish explanation for now. When absolute pointer reporting is enabled (see the VMMDevReq_GetMouseStatus VMM device request) the current pointer position can be requested with the VMMDevReqMousePointer request. This is reported as a percentage of the width and height (respectively) of the guest screen - expressed as a value from 0 to 0xFFFF - or of the virtual desktop for multi-monitor guests. The host works out what percentage values correspond to the position of the host pointer relative to the host window the machine is running in, and the Additions report the position back to the guest in a way that the guest OS can convert to the correct pixel offset. The host sends a VMM device event (basically an interrupt and a data word) when absolute reporting is enabled or disabled and when new position data is available. Hope that helps a bit. Regards, Michael -- ORACLE Deutschland B.V. & Co. KG Michael Thayer Werkstrasse 24 VirtualBox engineering 71384 Weinstadt, Germany mailto:[email protected] Hauptverwaltung: Riesstr. 25, D-80992 München Registergericht: Amtsgericht München, HRA 95603 Komplementärin: ORACLE Deutschland Verwaltung B.V. Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697 Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven _______________________________________________ vbox-dev mailing list [email protected] http://vbox.innotek.de/mailman/listinfo/vbox-dev
