diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-02-12 10:20:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-02-12 10:20:25 +0000 |
commit | 9b2658337029bc3d259f714dc5fe3bd0f7debef9 (patch) | |
tree | e84586db72c94b5e74a579a7a65902819c8440bb | |
parent | b6be4e77cde57ffc7a5f8ad717a16483758ee1e9 (diff) | |
download | drakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.tar drakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.tar.gz drakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.tar.bz2 drakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.tar.xz drakx-9b2658337029bc3d259f714dc5fe3bd0f7debef9.zip |
create probe_wacom_devices() and cleanup
-rw-r--r-- | perl-install/mouse.pm | 27 |
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 }; |