Commit 1b535a71 authored by Sam Lantinga's avatar Sam Lantinga

Added /dev/usbmouse to the list of mice to check

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4070
parent 98233844
...@@ -492,6 +492,7 @@ fprintf(stderr, "Last mouse mode: 0x%x\n", ch); ...@@ -492,6 +492,7 @@ fprintf(stderr, "Last mouse mode: 0x%x\n", ch);
int FB_OpenMouse(_THIS) int FB_OpenMouse(_THIS)
{ {
int i;
const char *mousedev; const char *mousedev;
const char *mousedrv; const char *mousedrv;
...@@ -522,6 +523,10 @@ fprintf(stderr, "Using ELO touchscreen\n"); ...@@ -522,6 +523,10 @@ fprintf(stderr, "Using ELO touchscreen\n");
/* STD MICE */ /* STD MICE */
if ( mousedev == NULL ) { 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 */ /* First try to use GPM in repeater mode */
if ( mouse_fd < 0 ) { if ( mouse_fd < 0 ) {
if ( gpm_available() ) { if ( gpm_available() ) {
...@@ -534,38 +539,25 @@ fprintf(stderr, "Using GPM mouse\n"); ...@@ -534,38 +539,25 @@ fprintf(stderr, "Using GPM mouse\n");
} }
} }
} }
/* Now try to use the new HID unified mouse device */ /* Now try to use a modern PS/2 mouse */
if ( mouse_fd < 0 ) { for ( i=0; (mouse_fd < 0) && ps2mice[i]; ++i ) {
mouse_fd = open("/dev/input/mice", O_RDWR, 0); mouse_fd = open(ps2mice[i], O_RDWR, 0);
if (mouse_fd < 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) { if (mouse_fd >= 0) {
/* rcg06112001 Attempt to set IMPS/2 mode first, even with envr var... */ /* rcg06112001 Attempt to set IMPS/2 mode */
if ( i == 0 ) {
set_imps2_mode(mouse_fd); set_imps2_mode(mouse_fd);
if (detect_imps2(mouse_fd)) {
mouse_drv = MOUSE_IMPS2;
} else {
mouse_drv = MOUSE_PS2;
} }
} if (detect_imps2(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) ) {
#ifdef DEBUG_MOUSE #ifdef DEBUG_MOUSE
fprintf(stderr, "Using IMPS/2 mouse\n"); fprintf(stderr, "Using IMPS2 mouse\n");
#endif #endif
mouse_drv = MOUSE_IMPS2; mouse_drv = MOUSE_IMPS2;
} else { } else {
#ifdef DEBUG_MOUSE #ifdef DEBUG_MOUSE
fprintf(stderr, "Using PS/2 mouse\n"); fprintf(stderr, "Using PS2 mouse\n");
#endif #endif
mouse_drv = MOUSE_PS2; mouse_drv = MOUSE_PS2;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment