qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] rfb patch and mouse movement
@ 2005-01-16  9:41 Brad Campbell
  2005-01-16 14:35 ` Jim C. Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Brad Campbell @ 2005-01-16  9:41 UTC (permalink / raw)
  To: qemu-devel

G'day all,

I have shoehorned the latest rfb patch http://libvncserver.sourceforge.net/qemu/qemu-rfb9.patch.gz
into the latest CVS Qemu. I'm having a few issues at the moment with mouse calibration under Windows 
XP. (A few issues with keypresses not being passed on also, but I'm sure that is entirely to do with 
the way I have integrated the patch)

I recall at some point, someone was working on emulating a synaptic touchpad to enable non-relative 
mouse input. I was having a think. Years ago I wrote some windows userspace drivers for 
touchscreens. MicroTouch and ELOTouch from memory. I still have the code around somewhere.

It worked by taking the data from the touchscreen, running it through the relevant calibration 
routines and sending windows absolute mouse movement messages. It worked rather well.

What I was thinking was perhaps emulating a serial port touchscreen, which would work with any OS 
that had support for one of those screens. A serial port being dead easy to accurately emulate and 
the touchscreen protocols are super simple to work with. Only hitch being you only get a single 
button to play with. Perhaps we could use the touchscreen for movement only and send clicks over the 
ps2 interface.

Just a wildly meandering thought as I struggle to make this session of qemu with vnc workable with 
Windows XP.

Thoughts?

Brad

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

* Re: [Qemu-devel] rfb patch and mouse movement
  2005-01-16  9:41 [Qemu-devel] rfb patch and mouse movement Brad Campbell
@ 2005-01-16 14:35 ` Jim C. Brown
  2005-01-17  4:23   ` Brad Campbell
  2005-01-17 14:49   ` Johannes Schindelin
  0 siblings, 2 replies; 9+ messages in thread
From: Jim C. Brown @ 2005-01-16 14:35 UTC (permalink / raw)
  To: qemu-devel

On Sun, Jan 16, 2005 at 01:41:09PM +0400, Brad Campbell wrote:
> G'day all,
> 
> I'm having a few issues at the moment with mouse 
> calibration under Windows XP.

Every OS with mouse support, with the sole exception of ReactOS, has calibration
problems. (At least, those OSes I've managed to test.) Why the mouse is
perfectly calibrated in ReactOS, I have no idea.

> 
> I recall at some point, someone was working on emulating a synaptic 
> touchpad to enable non-relative mouse input.

That was me. Turn out to be pointless, as you have the same scaling problem
regardless of whether or not the mouse is in relative or absolute mode.
And if you can fix the scaling problem, it's easier to stick with a PS/2
mouse, code-wise.

> I was having a think. Years 
> ago I wrote some windows userspace drivers for touchscreens. MicroTouch and 
> ELOTouch from memory. I still have the code around somewhere.
> 
> It worked by taking the data from the touchscreen, running it through the 
> relevant calibration routines and sending windows absolute mouse movement 
> messages. It worked rather well.

What "relevant calibration routines" are we looking at here?

> 
> Perhaps we could use the touchscreen for movement only 
> and send clicks over the ps2 interface.

That would require an ugly custom guest driver.

> 
> Just a wildly meandering thought as I struggle to make this session of qemu 
> with vnc workable with Windows XP.

Does pressing Ctrl-Alt (or Ctrl-Shift??) to ungrab the mouse, then realiging
the host and guest pointers, and then regrabing the mouse work? This is what I
do w/ my no-sdl patch.

> 
> Thoughts?
> 
> Brad
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 

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

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

* Re: [Qemu-devel] rfb patch and mouse movement
  2005-01-16 14:35 ` Jim C. Brown
@ 2005-01-17  4:23   ` Brad Campbell
  2005-01-17 15:22     ` Jim C. Brown
  2005-01-17 14:49   ` Johannes Schindelin
  1 sibling, 1 reply; 9+ messages in thread
From: Brad Campbell @ 2005-01-17  4:23 UTC (permalink / raw)
  To: qemu-devel

Jim C. Brown wrote:

>>It worked by taking the data from the touchscreen, running it through the 
>>relevant calibration routines and sending windows absolute mouse movement 
>>messages. It worked rather well.
> 
> 
> What "relevant calibration routines" are we looking at here?

Pretty simple linear scaling and axis inversion for touchscreens. Nothing complex. Just calculate 
the max/min points based on some calibration, scale them up to 16 bit values and feed them to 
windows using a mouse movement message.

>>Perhaps we could use the touchscreen for movement only 
>>and send clicks over the ps2 interface.
> 
> 
> That would require an ugly custom guest driver.

Not really. Touchscreen drivers and mouse drives co-exist. Just send the movement down the touch 
screen line and the clicks down the PS2 line. Simple.

>>Just a wildly meandering thought as I struggle to make this session of qemu 
>>with vnc workable with Windows XP.
> 
> 
> Does pressing Ctrl-Alt (or Ctrl-Shift??) to ungrab the mouse, then realiging
> the host and guest pointers, and then regrabing the mouse work? This is what I
> do w/ my no-sdl patch.

I'm using VNC only, so there is no grab/un-grab.

Now I at least I have it working so it's not such an issue, but it is annoying. I'll think about it 
a bit more as it's getting serious daily use now.

Regards,
Brad

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

* Re: [Qemu-devel] rfb patch and mouse movement
  2005-01-16 14:35 ` Jim C. Brown
  2005-01-17  4:23   ` Brad Campbell
@ 2005-01-17 14:49   ` Johannes Schindelin
  2005-01-17 15:18     ` Jim C. Brown
  1 sibling, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2005-01-17 14:49 UTC (permalink / raw)
  To: qemu-devel

Hi,

On Sun, 16 Jan 2005, Jim C. Brown wrote:

> On Sun, Jan 16, 2005 at 01:41:09PM +0400, Brad Campbell wrote:
> > G'day all,
> >
> > I'm having a few issues at the moment with mouse
> > calibration under Windows XP.
>
> Every OS with mouse support, with the sole exception of ReactOS, has calibration
> problems. (At least, those OSes I've managed to test.) Why the mouse is
> perfectly calibrated in ReactOS, I have no idea.

I have: ReactOS does not do mouse acceleration, thus one tick from the
mouse always corresponds to one pixel movement on the screen, whereas X11
on Linux normally accelerates the mouse, i.e. one thick means one pixel
movement, but 10 ticks mean 20 pixels.

> That would require an ugly custom guest driver.

Agree. Maybe there's support in some Windows and some Linux versions, but
it is yet another ugly dependency, which is not met by every guest.

> Does pressing Ctrl-Alt (or Ctrl-Shift??) to ungrab the mouse, then realiging
> the host and guest pointers, and then regrabing the mouse work? This is what I
> do w/ my no-sdl patch.

This doesn't work yet with rfb9, because Ctrl-Alt doesn't alter the state,
i.e. the mouse updates are still forwarded after pressing Ctrl-Alt, and
even after a switch to the console or serial.

I want to rework the auto-calibration, but time's sparse. Also, somebody
on the list mentioned that he was working on this himself, but he didn't
answer my emails.

Ciao,
Dscho

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

* Re: [Qemu-devel] rfb patch and mouse movement
  2005-01-17 14:49   ` Johannes Schindelin
@ 2005-01-17 15:18     ` Jim C. Brown
  2005-01-17 18:02       ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Jim C. Brown @ 2005-01-17 15:18 UTC (permalink / raw)
  To: qemu-devel

On Mon, Jan 17, 2005 at 03:49:23PM +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Sun, 16 Jan 2005, Jim C. Brown wrote:
> 
> > On Sun, Jan 16, 2005 at 01:41:09PM +0400, Brad Campbell wrote:
> > > G'day all,
> > >
> > > I'm having a few issues at the moment with mouse
> > > calibration under Windows XP.
> >
> > Every OS with mouse support, with the sole exception of ReactOS, has calibration
> > problems. (At least, those OSes I've managed to test.) Why the mouse is
> > perfectly calibrated in ReactOS, I have no idea.
> 
> I have: ReactOS does not do mouse acceleration, thus one tick from the
> mouse always corresponds to one pixel movement on the screen, whereas X11
> on Linux normally accelerates the mouse, i.e. one thick means one pixel
> movement, but 10 ticks mean 20 pixels.
> 

Then, in theory, if we could tell the guest X11 server to not do acceleration,
the problem would go away?

If so, that would also work for a Windows guest, tho the method of execution
would probably be difficult.

> > Does pressing Ctrl-Alt (or Ctrl-Shift??) to ungrab the mouse, then realiging
> > the host and guest pointers, and then regrabing the mouse work? This is what I
> > do w/ my no-sdl patch.
> 
> This doesn't work yet with rfb9, because Ctrl-Alt doesn't alter the state,
> i.e. the mouse updates are still forwarded after pressing Ctrl-Alt, and
> even after a switch to the console or serial.

Is this due to a limitation of VNC (in which case we might say, Ctrl-A Ctrl-A
does the switch), or is it merely due to a lack of support in the code (that
someone else could add easily by adding a few lines of code)?

> 
> I want to rework the auto-calibration, but time's sparse. Also, somebody
> on the list mentioned that he was working on this himself, but he didn't
> answer my emails.
> 
> Ciao,
> Dscho
> 
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 

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

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

* Re: [Qemu-devel] rfb patch and mouse movement
  2005-01-17  4:23   ` Brad Campbell
@ 2005-01-17 15:22     ` Jim C. Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Jim C. Brown @ 2005-01-17 15:22 UTC (permalink / raw)
  To: qemu-devel

On Mon, Jan 17, 2005 at 08:23:28AM +0400, Brad Campbell wrote:
> Jim C. Brown wrote:
> 
> >>It worked by taking the data from the touchscreen, running it through the 
> >>relevant calibration routines and sending windows absolute mouse movement 
> >>messages. It worked rather well.
> >
> >
> >What "relevant calibration routines" are we looking at here?
> 
> Pretty simple linear scaling and axis inversion for touchscreens. Nothing 
> complex. Just calculate the max/min points based on some calibration, scale 
> them up to 16 bit values and feed them to windows using a mouse movement 
> message.

> 
> >>Perhaps we could use the touchscreen for movement only 
> >>and send clicks over the ps2 interface.
> >
> >
> >That would require an ugly custom guest driver.
> 
> Not really. Touchscreen drivers and mouse drives co-exist. Just send the 
> movement down the touch screen line and the clicks down the PS2 line. 
> Simple.
> 

Hmm .. if hardware which uses this method already exists, then it's a different
story.

Still, unless the calibration problem is solved, not worth the trouble.

> 
> Regards,
> Brad
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 

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

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

* Re: [Qemu-devel] rfb patch and mouse movement
  2005-01-17 15:18     ` Jim C. Brown
@ 2005-01-17 18:02       ` Johannes Schindelin
  2005-01-17 18:15         ` [Qemu-devel] " Ronald
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2005-01-17 18:02 UTC (permalink / raw)
  To: qemu-devel

Hi,

On Mon, 17 Jan 2005, Jim C. Brown wrote:

> Then, in theory, if we could tell the guest X11 server to not do
> acceleration, the problem would go away?

Yes. I tested this with Windows 98 and ME, but I am dumb enough not to
know how to do that with X11.

> If so, that would also work for a Windows guest, tho the method of
> execution would probably be difficult.

Start/Preferences/Mouse Settings/Acceleration, set to "None".

> > > Does pressing Ctrl-Alt (or Ctrl-Shift??) to ungrab the mouse, then
> > > realiging the host and guest pointers, and then regrabing the mouse
> > > work? This is what I do w/ my no-sdl patch.
> >
> > This doesn't work yet with rfb9, because Ctrl-Alt doesn't alter the
> > state, i.e. the mouse updates are still forwarded after pressing
> > Ctrl-Alt, and even after a switch to the console or serial.
>
> Is this due to a limitation of VNC (in which case we might say, Ctrl-A
> Ctrl-A does the switch), or is it merely due to a lack of support in the
> code (that someone else could add easily by adding a few lines of code)?

This is a limitation of the author ;-) Seems like a good idea, though.

Ciao,
Dscho

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

* [Qemu-devel] Re: rfb patch and mouse movement
  2005-01-17 18:02       ` Johannes Schindelin
@ 2005-01-17 18:15         ` Ronald
  2005-01-17 19:04           ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Ronald @ 2005-01-17 18:15 UTC (permalink / raw)
  To: qemu-devel

Le Mon, 17 Jan 2005 19:02:53 +0100, Johannes Schindelin a écrit :

> Hi,
> 
> On Mon, 17 Jan 2005, Jim C. Brown wrote:
> 
>> Then, in theory, if we could tell the guest X11 server to not do
>> acceleration, the problem would go away?
> 
> Yes. I tested this with Windows 98 and ME, but I am dumb enough not to
> know how to do that with X11.
> 

$xset m 0
or
-a 0 passed to the X server

> Ciao,
> Dscho

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

* Re: [Qemu-devel] Re: rfb patch and mouse movement
  2005-01-17 18:15         ` [Qemu-devel] " Ronald
@ 2005-01-17 19:04           ` Johannes Schindelin
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Schindelin @ 2005-01-17 19:04 UTC (permalink / raw)
  To: daimon55, qemu-devel

Hi,

On Mon, 17 Jan 2005, Ronald wrote:

> Le Mon, 17 Jan 2005 19:02:53 +0100, Johannes Schindelin a écrit :
>
> > Yes. I tested this with Windows 98 and ME, but I am dumb enough not to
> > know how to do that with X11.
> >
>
> $xset m 0
> or
> -a 0 passed to the X server

Thank you for not letting me die dumb!

Ciao,
Dscho

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

end of thread, other threads:[~2005-01-17 19:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-16  9:41 [Qemu-devel] rfb patch and mouse movement Brad Campbell
2005-01-16 14:35 ` Jim C. Brown
2005-01-17  4:23   ` Brad Campbell
2005-01-17 15:22     ` Jim C. Brown
2005-01-17 14:49   ` Johannes Schindelin
2005-01-17 15:18     ` Jim C. Brown
2005-01-17 18:02       ` Johannes Schindelin
2005-01-17 18:15         ` [Qemu-devel] " Ronald
2005-01-17 19:04           ` Johannes Schindelin

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).