# HG changeset patch # User Sam Lantinga # Date 992659719 0 # Node ID 280ff3af2ecc8ddb6f985f3b38e90e558d4d73a2 # Parent ac6645260d318211e78d40aff0150cc6fa50555d Added /dev/usbmouse to the list of mice to check diff -r ac6645260d31 -r 280ff3af2ecc src/video/fbcon/SDL_fbevents.c --- a/src/video/fbcon/SDL_fbevents.c Sat Jun 16 01:51:42 2001 +0000 +++ b/src/video/fbcon/SDL_fbevents.c Sat Jun 16 02:48:39 2001 +0000 @@ -492,6 +492,7 @@ int FB_OpenMouse(_THIS) { + int i; const char *mousedev; const char *mousedrv; @@ -522,6 +523,10 @@ /* STD MICE */ if ( mousedev == NULL ) { + /* FIXME someday... allow multiple mice in this driver */ + char *ps2mice[] = { + "/dev/input/mice", "/dev/usbmouse", "/dev/psaux", NULL + }; /* First try to use GPM in repeater mode */ if ( mouse_fd < 0 ) { if ( gpm_available() ) { @@ -534,38 +539,25 @@ } } } - /* Now try to use the new HID unified mouse device */ - if ( mouse_fd < 0 ) { - mouse_fd = open("/dev/input/mice", O_RDWR, 0); + /* Now try to use a modern PS/2 mouse */ + for ( i=0; (mouse_fd < 0) && ps2mice[i]; ++i ) { + mouse_fd = open(ps2mice[i], O_RDWR, 0); if (mouse_fd < 0) { - mouse_fd = open("/dev/input/mice", O_RDONLY, 0); + mouse_fd = open(ps2mice[i], O_RDONLY, 0); } if (mouse_fd >= 0) { - /* rcg06112001 Attempt to set IMPS/2 mode first, even with envr var... */ - set_imps2_mode(mouse_fd); - - if (detect_imps2(mouse_fd)) { - mouse_drv = MOUSE_IMPS2; - } else { - mouse_drv = MOUSE_PS2; + /* rcg06112001 Attempt to set IMPS/2 mode */ + if ( i == 0 ) { + set_imps2_mode(mouse_fd); } - } - } - /* Now try to use a modern PS/2 port mouse */ - if ( mouse_fd < 0 ) { - mouse_fd = open("/dev/psaux", O_RDWR, 0); - if ( mouse_fd < 0 ) { - mouse_fd = open("/dev/psaux", O_RDONLY, 0); - } - if ( mouse_fd >= 0 ) { - if ( detect_imps2(mouse_fd) ) { + if (detect_imps2(mouse_fd)) { #ifdef DEBUG_MOUSE -fprintf(stderr, "Using IMPS/2 mouse\n"); +fprintf(stderr, "Using IMPS2 mouse\n"); #endif mouse_drv = MOUSE_IMPS2; } else { #ifdef DEBUG_MOUSE -fprintf(stderr, "Using PS/2 mouse\n"); +fprintf(stderr, "Using PS2 mouse\n"); #endif mouse_drv = MOUSE_PS2; }