ia64/linux-2.6.18-xen.hg

changeset 440:1edfea26a2a9

fbfront: Slightly streamline handling of wheel (z-axis) mouse events.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Feb 25 09:15:12 2008 +0000 (2008-02-25)
parents be78655b9e87
children 30993af85114 43de9d7c3c63
files drivers/xen/fbfront/xenkbd.c
line diff
     1.1 --- a/drivers/xen/fbfront/xenkbd.c	Fri Feb 22 16:52:34 2008 +0000
     1.2 +++ b/drivers/xen/fbfront/xenkbd.c	Mon Feb 25 09:15:12 2008 +0000
     1.3 @@ -64,13 +64,11 @@ static irqreturn_t input_handler(int rq,
     1.4  		dev = info->ptr;
     1.5  		switch (event->type) {
     1.6  		case XENKBD_TYPE_MOTION:
     1.7 -			if ( event->motion.rel_z == 1 || event->motion.rel_z == -1 ) {
     1.8 -				input_report_rel(dev, REL_WHEEL, 0 - event->motion.rel_z);
     1.9 -			}           
    1.10 -			else {
    1.11 -				input_report_rel(dev, REL_X, event->motion.rel_x);
    1.12 -				input_report_rel(dev, REL_Y, event->motion.rel_y);
    1.13 -			}
    1.14 +			if (event->motion.rel_z)
    1.15 +				input_report_rel(dev, REL_WHEEL,
    1.16 +						 0 - event->motion.rel_z);
    1.17 +			input_report_rel(dev, REL_X, event->motion.rel_x);
    1.18 +			input_report_rel(dev, REL_Y, event->motion.rel_y);
    1.19  			break;
    1.20  		case XENKBD_TYPE_KEY:
    1.21  			dev = NULL;
    1.22 @@ -86,13 +84,11 @@ static irqreturn_t input_handler(int rq,
    1.23  				       event->key.keycode);
    1.24  			break;
    1.25  		case XENKBD_TYPE_POS:
    1.26 -			if ( event->pos.abs_z == 1 || event->pos.abs_z == -1 ) {
    1.27 -				input_report_rel(dev, REL_WHEEL, 0 - event->pos.abs_z);
    1.28 -			}
    1.29 -			else {
    1.30 -				input_report_abs(dev, ABS_X, event->pos.abs_x);
    1.31 -				input_report_abs(dev, ABS_Y, event->pos.abs_y);
    1.32 -			}
    1.33 +			if (event->pos.abs_z)
    1.34 +				input_report_rel(dev, REL_WHEEL,
    1.35 +						 0 - event->pos.abs_z);
    1.36 +			input_report_abs(dev, ABS_X, event->pos.abs_x);
    1.37 +			input_report_abs(dev, ABS_Y, event->pos.abs_y);
    1.38  			break;
    1.39  		}
    1.40  		if (dev)