diff options
Diffstat (limited to 'perl-install/mouse.pm')
-rw-r--r-- | perl-install/mouse.pm | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm index 2bc5d5efa..7d0cb80c4 100644 --- a/perl-install/mouse.pm +++ b/perl-install/mouse.pm @@ -215,15 +215,19 @@ sub detect() { detect_devices::hasMousePS2("psaux") and return fullname2mouse("PS/2|Standard", unsafe => 1), $wacom; } - if (modules::get_alias("usb-interface") && detect_devices::hasUsbMouse()) { - eval { - modules::load("usbmouse"); - modules::load("mousedev"); - }; - !$@ && detect_devices::tryOpen("usbmouse") and return fullname2mouse("USB|Generic"), $wacom; - eval { - modules::unload("mousedev"); - modules::unload("usbmouse"); + if (modules::get_alias("usb-interface")) { + if (my (@l) = detect_devices::usbMice()) { + log::l("found usb mouse $_->{driver} $_->{description} ($_->{type})") foreach @l; + eval { + modules::load("usbmouse"); + modules::load("mousedev"); + }; + !$@ && detect_devices::tryOpen("usbmouse") and + return fullname2mouse($l[0]{driver} =~ /Mouse:(.*)/ ? $1 : "USB|Generic"), $wacom; + eval { + modules::unload("mousedev"); + modules::unload("usbmouse"); + } } } |