Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide cursor when mouse leaves the VM #14

Open
NattyNarwhal opened this issue Nov 26, 2021 · 7 comments
Open

Hide cursor when mouse leaves the VM #14

NattyNarwhal opened this issue Nov 26, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@NattyNarwhal
Copy link
Owner

Is this something in the flags (high word of EAX) we're missing out on?

@NattyNarwhal NattyNarwhal added the enhancement New feature or request label Nov 26, 2021
@supercomputer7
Copy link

I don't know if you ask this as you open this for a discussion, but as far as I know, the VMMouse protocol doesn't support such case. You might be able to check if the mouse is very near the corner of the screen or something like that and have timeout to hide the cursor.
I also looked in the source code of QEMU 5.2.0 for vmmouse and didn't see evidence for such scenario.

@NattyNarwhal
Copy link
Owner Author

I guess it could check if BX/CX are 0 or FFFFh, though not sure if that's wise (i.e. it's on the edge). I'm unsure if there's an event sent to the VM on cursor exit, and I'm also unsure what the high word of EAX is; klange in OSDev documents it as a thing, but I've never seen anything check it nor does QEMU send it....

@supercomputer7
Copy link

As far as I know there is no event being sent when the cursor exits the VM window. Even if VMWare actually supports such thing, I really don’t think it worth the hard work of debugging it with VMWare. Also, if QEMU is not supporting this, it will be very VMWare-specific feature. Not a good idea probably.

@NattyNarwhal
Copy link
Owner Author

Yeah, I agree. I was just curious what those flags were, and the fact it seems modern vmtools (well, and the tablet) seem to do this.

@supercomputer7
Copy link

Yeah, I agree. I was just curious what those flags were, and the fact it seems modern vmtools (well, and the tablet) seem to do this.

It could be that the vmtools code is able to do so via an extension through the VMWare backdoor. Might be interesting project to learn more about this, you could also leverage this to automatically set the resolution when the user changes the window size of the VM monitor.

@NattyNarwhal
Copy link
Owner Author

Well, Windows 3.x display drivers are fixed resolution - you have to restart Windows and I believe swap the driver to actually change resolution...

@supercomputer7
Copy link

Well, Windows 3.x display drivers are fixed resolution - you have to restart Windows and I believe swap the driver to actually change resolution...

I don’t know much about Windows 3.1 driver model but if that’s the case then I definitely won’t bother to try implementing that. And even the fact that you wrote a vmmouse driver for such old OS is both unexpected and brilliant and I wouldn’t expect from you to implement features like changing resolution dynamically or “knowing” if the mouse is not in the VM window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants