Markus Armbruster <armbru@xxxxxxxxxx> writes:
> All right, I think I understand now how this works.
>
> 1. X reports wheel motion as button 4 & 5.
>
> 2. VNC viewer duly transmits that into QEMU.
>
> 3. QEMU converts it to -1/+1 on z-axis (pointer_event() in vnc.c).
>
> 4. Your patch transmits that to the vkbd frontend.
>
> Bug: struct xenkbd_position claims abs_z is absolute, which is not
> true.
Patch appended.
> Question: is that the protocol we want? More below.
>
> 5. The vkbd frontend stuffs the z-axis motion into the input layer as
> REL_WHEEL, with the sign reversed.
>
> Bug: it ignores movement other than -1/+1. A case can be made for
> ignoring 0.
>
> Bug: when it acts on z-axis movement, it ignores x/y movement /
> position.
Fixed in changeset 439:1edfea26a2a9
> 6. X converts the wheel movement back to button 4 & 5.
[...]
diff -r 43de9d7c3c63 drivers/xen/fbfront/xenkbd.c
--- a/drivers/xen/fbfront/xenkbd.c Tue Feb 26 17:59:18 2008 +0000
+++ b/drivers/xen/fbfront/xenkbd.c Thu Feb 28 09:44:59 2008 +0100
@@ -66,7 +66,7 @@ static irqreturn_t input_handler(int rq,
case XENKBD_TYPE_MOTION:
if (event->motion.rel_z)
input_report_rel(dev, REL_WHEEL,
- 0 - event->motion.rel_z);
+ -event->motion.rel_z);
input_report_rel(dev, REL_X, event->motion.rel_x);
input_report_rel(dev, REL_Y, event->motion.rel_y);
break;
@@ -84,9 +84,9 @@ static irqreturn_t input_handler(int rq,
event->key.keycode);
break;
case XENKBD_TYPE_POS:
- if (event->pos.abs_z)
+ if (event->pos.rel_z)
input_report_rel(dev, REL_WHEEL,
- 0 - event->pos.abs_z);
+ -event->pos.rel_z);
input_report_abs(dev, ABS_X, event->pos.abs_x);
input_report_abs(dev, ABS_Y, event->pos.abs_y);
break;
diff -r 43de9d7c3c63 include/xen/interface/io/kbdif.h
--- a/include/xen/interface/io/kbdif.h Tue Feb 26 17:59:18 2008 +0000
+++ b/include/xen/interface/io/kbdif.h Thu Feb 28 09:44:59 2008 +0100
@@ -65,7 +65,7 @@ struct xenkbd_position
uint8_t type; /* XENKBD_TYPE_POS */
int32_t abs_x; /* absolute X position (in FB pixels) */
int32_t abs_y; /* absolute Y position (in FB pixels) */
- int32_t abs_z; /* absolute Z position (wheel) */
+ int32_t rel_z; /* relative Z motion (wheel) */
};
#define XENKBD_IN_EVENT_SIZE 40
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|