Simplify auto-detect mouse for WSCONS_SUPPORT
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Matthieu Herrbb <matthieu.herrb@laas.fr> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
b3d2164a03
commit
7762de65e1
|
@ -63,6 +63,9 @@ static char *DFLT_MOUSE_PROTO = "auto";
|
|||
#elif defined(linux)
|
||||
static char DFLT_MOUSE_DEV[] = "/dev/input/mice";
|
||||
static char DFLT_MOUSE_PROTO[] = "auto";
|
||||
#elif defined(WSCONS_SUPPORT)
|
||||
static char *DFLT_MOUSE_DEV = "/dev/wsmouse";
|
||||
static char *DFLT_MOUSE_PROTO = "wsmouse";
|
||||
#else
|
||||
static char *DFLT_MOUSE_DEV = "/dev/mouse";
|
||||
static char *DFLT_MOUSE_PROTO = "auto";
|
||||
|
@ -154,16 +157,6 @@ configureInputSection (void)
|
|||
/* Crude mechanism to auto-detect mouse (os dependent) */
|
||||
{
|
||||
int fd;
|
||||
#ifdef WSCONS_SUPPORT
|
||||
fd = open("/dev/wsmouse", 0);
|
||||
if (fd >= 0) {
|
||||
DFLT_MOUSE_DEV = "/dev/wsmouse";
|
||||
DFLT_MOUSE_PROTO = "wsmouse";
|
||||
close(fd);
|
||||
} else {
|
||||
ErrorF("cannot open /dev/wsmouse\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
fd = open(DFLT_MOUSE_DEV, 0);
|
||||
if (fd != -1) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user