xserver/hw/xgl/egl evdev.c,1.4,1.5
Dave Airlie
xserver-commit at pdx.freedesktop.org
Tue Dec 27 18:43:52 PST 2005
Committed by: airlied
Update of /cvs/xserver/xserver/hw/xgl/egl
In directory gabe:/tmp/cvs-serv18918
Modified Files:
evdev.c
Log Message:
recommit previous changes to evdev.c
Index: evdev.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/egl/evdev.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- evdev.c 23 Dec 2005 02:07:58 -0000 1.4
+++ evdev.c 28 Dec 2005 02:43:50 -0000 1.5
@@ -112,7 +112,7 @@
{
KdMouseInfo *mi = closure;
Kevdev *ke = mi->driver;
- int i, n, f = 0;
+ int i, n;
struct input_event events[NUM_EVENTS];
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
@@ -131,26 +131,46 @@
ErrorF ("key %d %d\n", events[i].code, events[i].value);
else
ErrorF ("key 0x%x %d\n", events[i].code, events[i].value);
- switch (events[i].code) {
- case BTN_LEFT:
- f = KD_BUTTON_1;
+
+ if (events[i].value==1) {
+ switch (events[i].code) {
+ case BTN_LEFT:
+ flags |= KD_BUTTON_1;
break;
- case BTN_RIGHT:
- f = KD_BUTTON_2;
+ case BTN_RIGHT:
+ flags |= KD_BUTTON_3;
break;
- case BTN_MIDDLE:
- f = KD_BUTTON_3;
+ case BTN_MIDDLE:
+ flags |= KD_BUTTON_2;
break;
- case BTN_FORWARD:
- f = KD_BUTTON_4;
+ case BTN_FORWARD:
+ flags |= KD_BUTTON_4;
break;
- case BTN_BACK:
- f = KD_BUTTON_5;
+ case BTN_BACK:
+ flags |= KD_BUTTON_5;
break;
- }
- flags |= f;
- KdEnqueueMouseEvent (mi, KD_MOUSE_DELTA | flags, 0, 0);
- ErrorF("Flags is %x\n", flags);
+ }
+ }
+ else if (events[i].value==0) {
+ switch (events[i].code) {
+ case BTN_LEFT:
+ flags &= ~KD_BUTTON_1;
+ break;
+ case BTN_RIGHT:
+ flags &= ~KD_BUTTON_3;
+ break;
+ case BTN_MIDDLE:
+ flags &= ~KD_BUTTON_2;
+ break;
+ case BTN_FORWARD:
+ flags &= ~KD_BUTTON_4;
+ break;
+ case BTN_BACK:
+ flags &= ~KD_BUTTON_5;
+ break;
+ }
+ }
+ KdEnqueueMouseEvent (mi, KD_MOUSE_DELTA | flags, 0, 0);
break;
case EV_REL:
ke->rel[events[i].code] += events[i].value;
@@ -166,12 +186,12 @@
int EvdevInputType;
char *kdefaultEvdev[] = {
-// "/dev/input/event0",
-// "/dev/input/event1",
-// "/dev/input/event2",
-// "/dev/input/event3",
-// "/dev/input/event4",
- "/dev/input/event5",
+ // "/dev/input/event0",
+ "/dev/input/event1",
+ // "/dev/input/event2",
+ // "/dev/input/event3",
+ // "/dev/input/event4",
+ // "/dev/input/event5",
};
#define NUM_DEFAULT_EVDEV (sizeof (kdefaultEvdev) / sizeof (kdefaultEvdev[0]))
@@ -477,12 +497,12 @@
}
char *kdefaultEvdev1[] = {
-// "/dev/input/event0",
-// "/dev/input/event1",
-// "/dev/input/event2",
- "/dev/input/event3",
-// "/dev/input/event4",
-// "/dev/input/event5",
+ "/dev/input/event0",
+ // "/dev/input/event1",
+ // "/dev/input/event2",
+ // "/dev/input/event3",
+ // "/dev/input/event4",
+ // "/dev/input/event5",
};
#define NUM_DEFAULT_EVDEV1 (sizeof (kdefaultEvdev1) / sizeof (kdefaultEvdev1[0]))
More information about the xserver-commit
mailing list