src/video/fbcon/SDL_fbevents.c
changeset 4 4f6c5f021323
parent 0 74212992fb08
child 59 b685c94f8db7
--- a/src/video/fbcon/SDL_fbevents.c	Thu Apr 26 16:52:42 2001 +0000
+++ b/src/video/fbcon/SDL_fbevents.c	Thu Apr 26 16:54:56 2001 +0000
@@ -619,7 +619,8 @@
 	int button = 0;
 	int dx = 0, dy = 0;
 	int packetsize = 0;
-
+	int realx, realy;
+	
 	/* Figure out the mouse packet size */
 	switch (mouse_drv) {
 		case MOUSE_NONE:
@@ -647,6 +648,18 @@
 			break;
 	}
 
+	/* Special handling for the quite sensitive ELO controller */
+	if (mouse_drv == MOUSE_ELO) {
+	
+	    /* try to read the next packet */
+	    if(eloReadPosition(this, mouse_fd, &dx, &dy, &button, &realx, &realy)) {
+		button = (button & 0x01) << 2;
+    		FB_vgamousecallback(button, relative, dx, dy);
+	    }
+	    
+	    return;
+	}
+	
 	/* Read as many packets as possible */
 	nread = read(mouse_fd, &mousebuf[start], BUFSIZ-start);
 	if ( nread < 0 ) {
@@ -740,25 +753,25 @@
 				dx =  (signed char)mousebuf[i+1];
 				dy = -(signed char)mousebuf[i+2];
 				break;
+			/*
 			case MOUSE_ELO:
-				/* ELO protocol has ELO_START_BYTE as first byte */
 				if ( mousebuf[i] != ELO_START_BYTE ) {
-					/* Go to next byte */
 					i -= (packetsize-1);
 					continue;
 				}
 
-				/* parse the packet */
 				if(!eloParsePacket(&(mousebuf[i]), &dx, &dy, &button)) {
-					break;
+					i -= (packetsize-1);
+					continue;
 				}
 				
 				button = (button & 0x01) << 2;
 
-				/* convert to screen coordinates */
 				eloConvertXY(this, &dx, &dy);
 				break;
+			*/
 
+			case MOUSE_ELO:
 			case NUM_MOUSE_DRVS:
 				/* Uh oh.. */
 				dx = 0;