qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [SDL] Problem with mouse grabbing
@ 2004-04-23 20:35 Jim C. Brown
  2004-04-25 23:45 ` Greg Alexander
  0 siblings, 1 reply; 5+ messages in thread
From: Jim C. Brown @ 2004-04-23 20:35 UTC (permalink / raw)
  To: qemu-devel

Why does qemu grab the mouse? Sometimes, when it is closing, I will
forget to press Ctrl-Shift, and the mouse ends up being unusable.

This got very old in a very short amount of time, so I edited sdl.c to simply
"follow" the X mouse pointer, ala VNC-style, and it works. There is a strange
bug, but aside from that it works perfectly. I find this more convenient
for handling the mouse. My question is: why does qemu grab the mouse pointer
instead of just following it? Is this for technical reasons or just because
the VM looks nicer that way?

P.S. The strange bug is simply that the virtual mouse pointer moves a little bit
faster than the real mouse pointer. It's annoying but still usable, although
it does cause the virtual mouse pointer to show up in odd places every now and
then.

-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [SDL] Problem with mouse grabbing
  2004-04-23 20:35 [Qemu-devel] [SDL] Problem with mouse grabbing Jim C. Brown
@ 2004-04-25 23:45 ` Greg Alexander
  2004-04-29 21:41   ` Jim C. Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Alexander @ 2004-04-25 23:45 UTC (permalink / raw)
  To: qemu-devel

QEMU Needs to grab the mouse because it emulates a real mouse, instead 
of using a pseudo-mouse driver.

As a result, mouse scaling will always be a problem, since all the user 
has to do is change the mouse scaling in the host OS to cause problems 
with the tracking (the scaling problem you noticed.)  That's not to 
mention if the mouse came in somewhere different from where it left. 
There's nothing to cause the emulated mouse pointer to move to the 
position where the real one entered the QEMU window.


GREG

Jim C. Brown wrote:

> Why does qemu grab the mouse? Sometimes, when it is closing, I will
> forget to press Ctrl-Shift, and the mouse ends up being unusable.
> 
> This got very old in a very short amount of time, so I edited sdl.c to simply
> "follow" the X mouse pointer, ala VNC-style, and it works. There is a strange
> bug, but aside from that it works perfectly. I find this more convenient
> for handling the mouse. My question is: why does qemu grab the mouse pointer
> instead of just following it? Is this for technical reasons or just because
> the VM looks nicer that way?
> 
> P.S. The strange bug is simply that the virtual mouse pointer moves a little bit
> faster than the real mouse pointer. It's annoying but still usable, although
> it does cause the virtual mouse pointer to show up in odd places every now and
> then.
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [SDL] Problem with mouse grabbing
  2004-04-25 23:45 ` Greg Alexander
@ 2004-04-29 21:41   ` Jim C. Brown
  2004-04-30 21:19     ` Gregory Alexander
  0 siblings, 1 reply; 5+ messages in thread
From: Jim C. Brown @ 2004-04-29 21:41 UTC (permalink / raw)
  To: gwa, qemu-devel

On Sun, Apr 25, 2004 at 06:45:08PM -0500, Greg Alexander wrote:
> QEMU Needs to grab the mouse because it emulates a real mouse, instead 
> of using a pseudo-mouse driver.

I don't follow you here. How would using a pseudo-mouse driver fix it?

> 
> As a result, mouse scaling will always be a problem, since all the user 
> has to do is change the mouse scaling in the host OS to cause problems 
> with the tracking (the scaling problem you noticed.) 

There must be some way to detect this. If we did know what the mouse scaling
was, this should be easy to compensate for.

> That's not to 
> mention if the mouse came in somewhere different from where it left. 
> There's nothing to cause the emulated mouse pointer to move to the 
> position where the real one entered the QEMU window.
> 

It does for me, actually. And I didn't deliberately change any code to make it
do this, either. It seems to be a side effect.

> 
> GREG
<snip> 

-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [SDL] Problem with mouse grabbing
  2004-04-29 21:41   ` Jim C. Brown
@ 2004-04-30 21:19     ` Gregory Alexander
  2004-04-30 22:05       ` [Qemu-devel] " Matthew Mastracci
  0 siblings, 1 reply; 5+ messages in thread
From: Gregory Alexander @ 2004-04-30 21:19 UTC (permalink / raw)
  To: jbrown106; +Cc: qemu-devel



Jim C. Brown wrote:
> On Sun, Apr 25, 2004 at 06:45:08PM -0500, Greg Alexander wrote:
> 
>>QEMU Needs to grab the mouse because it emulates a real mouse, instead 
>>of using a pseudo-mouse driver.
> 
> 
> I don't follow you here. How would using a pseudo-mouse driver fix it?

A pseudo-mouse driver for the guest OS would position the guest mouse 
pointer at the position of the host mouse pointer within the VNC window, 
instead of using relative mouse movements and pretending to be a real 
mouse to the guest OS.

>>As a result, mouse scaling will always be a problem, since all the user 
>>has to do is change the mouse scaling in the host OS to cause problems 
>>with the tracking (the scaling problem you noticed.) 
> 
> 
> There must be some way to detect this. If we did know what the mouse scaling
> was, this should be easy to compensate for.

If you have that much access to the guest OS, why not just write the 
pseudo-mouse driver?  Of course, there's also the option of adding a 
"dumb" scaling option to the emulated mouse that is user configurable.

>>That's not to 
>>mention if the mouse came in somewhere different from where it left. 
>>There's nothing to cause the emulated mouse pointer to move to the 
>>position where the real one entered the QEMU window.
>>
> 
> 
> It does for me, actually. And I didn't deliberately change any code to make it
> do this, either. It seems to be a side effect.

I guess if the scaling is accurate and it interprets moving off the 
screen and then moving back in at another location as a movement from 
where it left to where it came in, that would take care of the leaving 
and reentering problems.

GREG

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: [SDL] Problem with mouse grabbing
  2004-04-30 21:19     ` Gregory Alexander
@ 2004-04-30 22:05       ` Matthew Mastracci
  0 siblings, 0 replies; 5+ messages in thread
From: Matthew Mastracci @ 2004-04-30 22:05 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]


> A pseudo-mouse driver for the guest OS would position the guest mouse 
> pointer at the position of the host mouse pointer within the VNC 
> window, instead of using relative mouse movements and pretending to be 
> a real mouse to the guest OS.

Some pointing devices actually report absolute position as part of their 
packet stream.  Some examples:

 - Synaptics Touchpad
 - Various PS/2 touchscreen input drivers
 - Any USB HID-compliant device can

The first two require a "knocking" protocol to unlock the absolute 
positioning data.  Only the third has built-in support in Windows. 

Matt.

[-- Attachment #2: matt.vcf --]
[-- Type: text/x-vcard, Size: 286 bytes --]

begin:vcard
fn:Matthew Mastracci
n:Mastracci;Matthew
org:aclaro Softworks, inc.
adr:;;1900 a - 11 St. SE;Calgary;Alberta;T2H 3G2;Canada
email;internet:matt@aclaro.com
title:Software Developer
tel;work:(403) 299-6612
x-mozilla-html:FALSE
url:http://www.aclaro.com
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-04-30 22:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-23 20:35 [Qemu-devel] [SDL] Problem with mouse grabbing Jim C. Brown
2004-04-25 23:45 ` Greg Alexander
2004-04-29 21:41   ` Jim C. Brown
2004-04-30 21:19     ` Gregory Alexander
2004-04-30 22:05       ` [Qemu-devel] " Matthew Mastracci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).