summaryrefslogtreecommitdiffstats
path: root/perl-install/mouse.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/mouse.pm')
-rw-r--r--perl-install/mouse.pm15
1 files changed, 7 insertions, 8 deletions
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm
index 2382f9f1e..cb3dd3d9c 100644
--- a/perl-install/mouse.pm
+++ b/perl-install/mouse.pm
@@ -169,22 +169,21 @@ sub detect() {
detect_devices::hasMousePS2 and return { %{name2mouse("Generic Mouse (PS/2)")}, unsafe => 1 };
- eval { commands::modprobe("serial") };
- my ($r, $wacom) = mouseconfig(); return ($r, $wacom) if $r;
-
if (modules::get_alias("usb-interface") && detect_devices::hasUsbMouse()) {
eval {
modules::load("usbmouse");
modules::load("mousedev");
};
- if (!$@ && detect_devices::tryOpen("usbmouse")) {
- $wacom or modules::unload("serial");
- return name2mouse("USB Mouse"), $wacom;
+ !$@ && detect_devices::tryOpen("usbmouse") and return name2mouse("USB Mouse");
+ eval {
+ modules::unload("mousedev");
+ modules::unload("usbmouse");
}
- modules::unload("mousedev");
- modules::unload("usbmouse");
}
+ eval { commands::modprobe("serial") };
+ my ($r, $wacom) = mouseconfig(); return ($r, $wacom) if $r;
+
#- defaults to generic serial mouse on ttyS0.
#- Oops? using return let return a hash ref, if not using it, it return a list directly :-)
return { %{name2mouse("Generic Mouse (serial)")}, device => "ttyS0", unsafe => 1 };