Mouse Warp to Edge of Screen VirtualBox

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Geometrian
Member
Member
Posts: 77
Joined: Tue Nov 20, 2012 4:45 pm
Contact:

Mouse Warp to Edge of Screen VirtualBox

Post by Geometrian »

Hi,

I have successfully got PS/2 keyboard and mouse working, along with a nice, dynamically chosen VESA mode to go with it. It doesn't work quite right on Bochs, but it seems to be just fine on VirtualBox.

The only issue is that the mouse pointer seems to only be picking up relative movement within the window. If the mouse is outside the window, the cursor doesn't move. More troublingly, when the mouse cursor moves back over the window, the mouse cursor inside the VM doesn't jump to the location of the real mouse.

I wouldn't exactly expect it to, since the code only measures offsets, but I know it's possible (the Ubuntu VM I'm using to build this thing in the first place works great in this regard, for example). What should I look at to fix?

Thanks,
Last edited by Geometrian on Wed Jan 31, 2024 5:37 pm, edited 1 time in total.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Mouse Warp to Edge of Screen VirtualBox

Post by sortie »

This is possible through various extensions that VirtualBox provides that Linux is able to use. I wouldn't count on the mouse functioning correctly unless it is always inside the window or you muse the mouse capture mode of VirtualBox,
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Mouse Warp to Edge of Screen VirtualBox

Post by Gigasoft »

To support this you'll need to make hypervisor calls using the VirtualBox SDK.
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: Mouse Warp to Edge of Screen VirtualBox

Post by Kazinsal »

VirtualBox supports absolute pointing devices through both USB absolute pointing device emulation and calls to the hypervisor. The hypervisor option is probably easier to work with but still likely difficult. Easier than a whole USB stack I'm sure.
Post Reply