summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-02-12 10:20:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-02-12 10:20:25 +0000
commit9b2658337029bc3d259f714dc5fe3bd0f7debef9 (patch)
treee84586db72c94b5e74a579a7a65902819c8440bb /perl-install
parentb6be4e77cde57ffc7a5f8ad717a16483758ee1e9 (diff)
downloaddrakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.tar
drakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.tar.gz
drakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.tar.bz2
drakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.tar.xz
drakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.zip
create probe_wacom_devices() and cleanup
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/mouse.pm27
1 files changed, 14 insertions, 13 deletions
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm
index c1bbf7011..c0ed6a7ea 100644
--- a/perl-install/mouse.pm
+++ b/perl-install/mouse.pm
@@ -220,6 +220,19 @@ sub write {
}
}
+sub probe_wacom_devices() {
+ modules::get_probeall("usb-interface") or return;
+ my (@l) = detect_devices::usbWacom() or return;
+
+ log::l("found usb wacom $_->{driver} $_->{description} ($_->{type})") foreach @l;
+ my @wacom = eval {
+ modules::load("wacom", "evdev");
+ grep { detect_devices::tryOpen($_) } map_index { "input/event$::i" } @l
+ };
+ @wacom or eval { modules::unload("evdev", "wacom") };
+ @wacom;
+}
+
sub mouseconfig() {
my ($t, $mouse, @wacom);
@@ -285,19 +298,7 @@ sub detect() {
$auxmouse;
};
- my @wacom;
- if (modules::get_probeall("usb-interface")) {
- if (my (@l) = detect_devices::usbWacom()) {
- log::l("found usb wacom $_->{driver} $_->{description} ($_->{type})") foreach @l;
- eval { modules::load("wacom", "evdev") };
- if (!$@) {
- @wacom = grep { detect_devices::tryOpen($_) } map_index { "input/event$::i" } @l;
- }
- @wacom or eval { modules::unload("evdev", "wacom") };
- }
- } else {
- log::l("no usb interface found for wacom");
- }
+ my @wacom = probe_wacom_devices();
if (my $mouse = $fast_mouse_probe->()) {
return { wacom => \@wacom, %$mouse };