qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Brad Campbell <brad@wasp.net.au>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Gentlemen we have absolute movement! was:Absolute USB-HID device musings (was Re: VNC Terminal	Server)
Date: Mon, 10 Apr 2006 03:14:20 +0400	[thread overview]
Message-ID: <4439954C.1050609@wasp.net.au> (raw)
In-Reply-To: <443985C3.1000206@us.ibm.com>

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

Anthony Liguori wrote:
> 
> Final one of the night.  This patch disables relative mouse reporting 
> and disables grab automatically the first time SDL detects that the 
> absolute mouse was enabled.  Needs a lot of cleanup but I'm very happy 
> with the user experience on this one.
> 

Wish I'd just gone to bed now..
Heres a patch against your last one to implement wheel support.

Brad
-- 
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams

[-- Attachment #2: hid-wheel.patch --]
[-- Type: text/plain, Size: 2034 bytes --]

diff -ur qemu-clean/hw/usb-hid.c qemu/hw/usb-hid.c
--- qemu-clean/hw/usb-hid.c	2006-04-10 02:57:46.000000000 +0400
+++ qemu/hw/usb-hid.c	2006-04-10 03:11:58.000000000 +0400
@@ -101,7 +101,7 @@
         0x00,        /*  u8 country_code */
         0x01,        /*  u8 num_descriptors */
         0x22,        /*  u8 type; Report */
-        53, 0,       /*  u16 len */
+        65, 0,       /*  u16 len */
 
 	/* one endpoint (status change endpoint) */
 	0x07,       /*  u8  ep_bLength; */
@@ -145,14 +145,15 @@
         0x09, 0x31, /* Usage Y */
         0x15, 0x00, /* Logical Minimum 0 */
         0x27, 0xFF, 0xFF, 0x00, 0x00, /* Logical Maximum 0xffff */
-        0x75, 0x10, /* Report Size 32 */
+        0x75, 0x10, /* Report Size 16 */
         0x95, 0x02, /* Report Count 2 */
         0x81, 0x02, /* Input (Data, Var, Abs) */
-//      0x09, 0x32, /* Usage Z */
-//      0x15, 0x81, /* Logical Minimum -127 */
-//      0x25, 0x7F, /* Logical Maximum 127 */
-//      0x75, 0x08, /* Report Size 8 */
-//      0x95, 0x01, /* Report Count 1 */
+        0x09, 0x38, /* Usage Wheel */
+        0x15, 0x81, /* Logical Minimum -127 */
+        0x25, 0x7F, /* Logical Maximum 127 */
+        0x75, 0x08, /* Report Size 8 */
+        0x95, 0x01, /* Report Count 1 */
+        0x81, 0x02, /* Input (Data, Var, Rel) */
         0xC0,       /* End Collection */
         0xC0,       /* End Collection */
 };
@@ -224,14 +225,18 @@
 	qemu_add_mouse_event_handler(NULL, NULL);
 	absolute_mouse = 1;
     }
-
+/*
     dx = int_clamp(s->dx, -128, 127);
     dy = int_clamp(s->dy, -128, 127);
-    dz = int_clamp(s->dz, -128, 127);
 
     s->dx -= dx;
     s->dy -= dy;
+*/
+
+    dz = int_clamp(s->dz, -128, 127);
     s->dz -= dz;
+/* Appears we have to invert the wheel direction */
+    dz = 0 - dz;
     b = 0;
     if (s->buttons_state & MOUSE_EVENT_LBUTTON)
         b |= 0x01;
@@ -245,7 +250,8 @@
     buf[2] = s->X >> 8;
     buf[3] = s->Y & 0xff;
     buf[4] = s->Y >> 8;
-    l = 5;
+    buf[5] = dz;
+    l = 6;
 
     return l;
 }

  parent reply	other threads:[~2006-04-09 23:13 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-08 16:20 [Qemu-devel] VNC terminal server? Samuel Hunt
2006-04-08 18:12 ` Brad Campbell
2006-04-21 15:31   ` Troy Benjegerdes
2006-04-21 15:58     ` WaxDragon
2006-04-08 18:24 ` Johannes Schindelin
2006-04-08 18:37   ` Leonardo E. Reiter
2006-04-08 19:04     ` Johannes Schindelin
2006-04-08 19:15       ` Leonardo E. Reiter
2006-04-09  2:54       ` Anthony Liguori
2006-04-08 20:19     ` Brad Campbell
2006-04-08 20:29       ` Leonardo E. Reiter
2006-04-08 21:06       ` [Qemu-devel] Absolute USB-HID device musings (was Re: VNC Terminal Server) Leonardo E. Reiter
2006-04-08 21:18         ` Leonardo E. Reiter
2006-04-08 21:22         ` Brad Campbell
2006-04-08 21:36           ` Leonardo E. Reiter
2006-04-09  4:36         ` Anthony Liguori
2006-04-09 15:14           ` Jim C. Brown
2006-04-09 16:03           ` Leonardo E. Reiter
2006-04-09 16:49             ` Brad Campbell
2006-04-09 18:07             ` andrzej zaborowski
2006-04-09 18:35         ` Brad Campbell
2006-04-09 18:41           ` Lonnie Mendez
2006-04-09 19:22             ` Brad Campbell
2006-04-09 20:27               ` [Qemu-devel] Gentlemen we have absolute movement! was:Absolute " Brad Campbell
2006-04-09 20:31                 ` Anthony Liguori
2006-04-09 20:57                 ` Anthony Liguori
2006-04-09 21:02                   ` Brad Campbell
2006-04-09 21:10                   ` Brad Campbell
2006-04-09 21:20                     ` Johannes Schindelin
2006-04-09 21:35                       ` Brad Campbell
2006-04-09 21:39                     ` Anthony Liguori
2006-04-09 22:01                       ` Brad Campbell
2006-04-09 22:08                         ` Anthony Liguori
2006-04-09 22:12                           ` Brad Campbell
2006-04-09 22:18                           ` Brad Campbell
2006-04-09 23:14                           ` Brad Campbell [this message]
2006-04-10  3:40                             ` [Qemu-devel] USB Tablet Emulation (was: Gentlemen we have absolute movement! was:Absolute USB-HID device musings (was Re: VNC Terminal Server)) Anthony Liguori
2006-04-10  8:23                               ` [Qemu-devel] USB Tablet Emulation Brad Campbell
2006-04-10  8:32                                 ` Johannes Schindelin
2006-04-10 10:27                                   ` Brad Campbell
2006-04-10 11:27                                     ` Johannes Schindelin
2006-04-19 17:18                                 ` [Qemu-devel] USB Tablet Emulation + VNC patch Troy Benjegerdes
2006-04-21 21:13                                   ` Brad Campbell
2006-04-26  0:55                                     ` Troy Benjegerdes
2006-04-26  7:37                                       ` Brad Campbell
2006-04-10 14:58                               ` [Qemu-devel] USB Tablet Emulation Leonardo E. Reiter
2006-04-10 15:27                                 ` Anthony Liguori
2006-04-10 15:39                                   ` Leonardo E. Reiter
2006-04-10 16:08                                     ` Brad Campbell
2006-04-10 19:28                                       ` Brad Campbell
2006-04-10 19:44                                         ` Brad Campbell
2006-04-10 21:27                                           ` Brad Campbell
2006-04-10 21:39                                             ` Brad Campbell
2006-04-08 18:38   ` [Qemu-devel] VNC terminal server? Mark Williamson
2006-04-08 18:53     ` Johannes Schindelin
2006-04-08 19:01   ` Jim C. Brown
2006-04-08 19:12     ` Johannes Schindelin
2006-04-08 19:30       ` Jim C. Brown
2006-04-08 19:40         ` Johannes Schindelin
2006-04-09  2:55       ` Anthony Liguori
2006-04-09  2:53     ` Anthony Liguori
2006-04-08 19:21   ` andrzej zaborowski
2006-04-08 19:33     ` Leonardo E. Reiter
2006-04-09  2:59       ` Anthony Liguori
2006-04-09 16:06         ` Leonardo E. Reiter
2006-04-09 16:40           ` Anthony Liguori
2006-04-09  2:57     ` Anthony Liguori
2006-04-09  2:52   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4439954C.1050609@wasp.net.au \
    --to=brad@wasp.net.au \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).