From: "Pat Campbell" <plc@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH][LINUX] Decode mouse dz event
Date: Mon, 10 Dec 2007 06:27:58 -0700 [thread overview]
Message-ID: <475CDB84.3E48.0018.0@novell.com> (raw)
[-- 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
next reply other threads:[~2007-12-10 13:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-10 13:27 Pat Campbell [this message]
2007-12-10 13:53 ` [PATCH][LINUX] Decode mouse dz event Keir Fraser
2007-12-10 14:08 ` Pat Campbell
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=475CDB84.3E48.0018.0@novell.com \
--to=plc@novell.com \
--cc=xen-devel@lists.xensource.com \
/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 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.