* [PATCH][LINUX] Decode mouse dz event
@ 2007-12-10 13:27 Pat Campbell
2007-12-10 13:53 ` Keir Fraser
0 siblings, 1 reply; 3+ messages in thread
From: Pat Campbell @ 2007-12-10 13:27 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 191 bytes --]
Decodes mouse event packet dz value and passes it as a wheel event into
the input stream.
Please apply to linux-2.6.18-xen
Signed- off- by: Pat Campbell <plc@novell.com>
[-- Attachment #2: xenkbd-dz.patch --]
[-- Type: text/plain, Size: 1724 bytes --]
diff -r 69d413abd6c0 drivers/xen/fbfront/xenkbd.c
--- a/drivers/xen/fbfront/xenkbd.c Fri Dec 07 00:38:40 2007 +0000
+++ b/drivers/xen/fbfront/xenkbd.c Sat Dec 08 13:18:18 2007 -0700
@@ -64,8 +64,13 @@ static irqreturn_t input_handler(int rq,
dev = info->ptr;
switch (event->type) {
case XENKBD_TYPE_MOTION:
- input_report_rel(dev, REL_X, event->motion.rel_x);
- input_report_rel(dev, REL_Y, event->motion.rel_y);
+ if ( event->motion.rel_z == 1 || event->motion.rel_z == -1 ) {
+ input_report_rel(dev, REL_WHEEL, 0 - event->motion.rel_z);
+ }
+ else {
+ input_report_rel(dev, REL_X, event->motion.rel_x);
+ input_report_rel(dev, REL_Y, event->motion.rel_y);
+ }
break;
case XENKBD_TYPE_KEY:
dev = NULL;
@@ -81,8 +86,13 @@ static irqreturn_t input_handler(int rq,
event->key.keycode);
break;
case XENKBD_TYPE_POS:
- input_report_abs(dev, ABS_X, event->pos.abs_x);
- input_report_abs(dev, ABS_Y, event->pos.abs_y);
+ if ( event->pos.abs_z == 1 || event->pos.abs_z == -1 ) {
+ input_report_rel(dev, REL_WHEEL, 0 - event->pos.abs_z);
+ }
+ else {
+ input_report_abs(dev, ABS_X, event->pos.abs_x);
+ input_report_abs(dev, ABS_Y, event->pos.abs_y);
+ }
break;
}
if (dev)
@@ -152,7 +162,7 @@ int __devinit xenkbd_probe(struct xenbus
ptr->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
for (i = BTN_LEFT; i <= BTN_TASK; i++)
set_bit(i, ptr->keybit);
- ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+ ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL);
input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][LINUX] Decode mouse dz event
2007-12-10 13:27 [PATCH][LINUX] Decode mouse dz event Pat Campbell
@ 2007-12-10 13:53 ` Keir Fraser
2007-12-10 14:08 ` Pat Campbell
0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2007-12-10 13:53 UTC (permalink / raw)
To: Pat Campbell, xen-devel
Applied.
Can the frontend driver be sure that the dz field will have a sane value
with older backends that do not support the field? Or should this new field
be advertised via xenstore?
-- Keir
On 10/12/07 13:27, "Pat Campbell" <plc@novell.com> wrote:
>
> Decodes mouse event packet dz value and passes it as a wheel event into
> the input stream.
>
> Please apply to linux-2.6.18-xen
>
> Signed- off- by: Pat Campbell <plc@novell.com>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][LINUX] Decode mouse dz event
2007-12-10 13:53 ` Keir Fraser
@ 2007-12-10 14:08 ` Pat Campbell
0 siblings, 0 replies; 3+ messages in thread
From: Pat Campbell @ 2007-12-10 14:08 UTC (permalink / raw)
To: Keir Fraser, xen-devel
<Keir.Fraser@cl.cam.ac.uk> wrote:
> Applied.
>
> Can the frontend driver be sure that the dz field will have a sane value
> with older backends that do not support the field? Or should this new field
> be advertised via xenstore?
>
Patch is backwards compatible. Packet size has not changed and packet was
fortunately zero filled in the older code before setting the position values. Newer
frontend coupled with an older backend will always see dz as zero, no wheel event.
Pat
> -- Keir
>
> On 10/12/07 13:27, "Pat Campbell" <plc@novell.com> wrote:
>
>>
>> Decodes mouse event packet dz value and passes it as a wheel event into
>> the input stream.
>>
>> Please apply to linux- 2.6.18- xen
>>
>> Signed- off- by: Pat Campbell <plc@novell.com>
>>
>>
>>
>> _______________________________________________
>> Xen- devel mailing list
>> Xen- devel@lists.xensource.com
>> http://lists.xensource.com/xen- devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-10 14:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-10 13:27 [PATCH][LINUX] Decode mouse dz event Pat Campbell
2007-12-10 13:53 ` Keir Fraser
2007-12-10 14:08 ` Pat Campbell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.