src/video/fbcon/SDL_fbevents.c
changeset 1584 b786d9c15e42
parent 1582 43a565749fbf
child 1585 980d2a0dc2a3
equal deleted inserted replaced
1583:95451df282c3 1584:b786d9c15e42
   418 	fd_set fdset;
   418 	fd_set fdset;
   419 	struct timeval tv;
   419 	struct timeval tv;
   420 	int retval = 0;
   420 	int retval = 0;
   421 
   421 
   422 	if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
   422 	if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
       
   423 		/* Don't reset it, that'll clear IMPS/2 mode on some mice
   423 		if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
   424 		if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
   424 			retval = 1;
   425 			retval = 1;
   425 		}
   426 		}
       
   427 		*/
   426 	}
   428 	}
   427 
   429 
   428 	/* Get rid of any chatter from the above */
   430 	/* Get rid of any chatter from the above */
   429 	FD_ZERO(&fdset);
   431 	FD_ZERO(&fdset);
   430 	FD_SET(fd, &fdset);
   432 	FD_SET(fd, &fdset);
   543 
   545 
   544 	/* STD MICE */
   546 	/* STD MICE */
   545 
   547 
   546 	if ( mousedev == NULL ) {
   548 	if ( mousedev == NULL ) {
   547 		/* FIXME someday... allow multiple mice in this driver */
   549 		/* FIXME someday... allow multiple mice in this driver */
   548 		static const char * const ps2mice[] = {
   550 		static const char *ps2mice[] = {
   549 		    "/dev/input/mice", "/dev/usbmouse", "/dev/psaux", NULL
   551 		    "/dev/input/mice", "/dev/usbmouse", "/dev/psaux", NULL
   550 		};
   552 		};
   551 		/* First try to use GPM in repeater mode */
   553 		/* First try to use GPM in repeater mode */
   552 		if ( mouse_fd < 0 ) {
   554 		if ( mouse_fd < 0 ) {
   553 			if ( gpm_available() ) {
   555 			if ( gpm_available() ) {
   566 			if (mouse_fd < 0) {
   568 			if (mouse_fd < 0) {
   567 				mouse_fd = open(ps2mice[i], O_RDONLY, 0);
   569 				mouse_fd = open(ps2mice[i], O_RDONLY, 0);
   568 			}
   570 			}
   569 			if (mouse_fd >= 0) {
   571 			if (mouse_fd >= 0) {
   570 				/* rcg06112001 Attempt to set IMPS/2 mode */
   572 				/* rcg06112001 Attempt to set IMPS/2 mode */
   571 				if ( i == 0 ) {
   573 				set_imps2_mode(mouse_fd);
   572 					set_imps2_mode(mouse_fd);
       
   573 				}
       
   574 				if (detect_imps2(mouse_fd)) {
   574 				if (detect_imps2(mouse_fd)) {
   575 #ifdef DEBUG_MOUSE
   575 #ifdef DEBUG_MOUSE
   576 fprintf(stderr, "Using IMPS2 mouse\n");
   576 fprintf(stderr, "Using IMPS2 mouse\n");
   577 #endif
   577 #endif
   578 					mouse_drv = MOUSE_IMPS2;
   578 					mouse_drv = MOUSE_IMPS2;