summaryrefslogtreecommitdiffstats
path: root/perl-install/mouse.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-08-06 00:38:57 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-08-06 00:38:57 +0000
commitc75193289b79d4c0687aa6a597b51436568f8360 (patch)
tree0dde0958b1d48a729e30be420f9f8c94004b7ef8 /perl-install/mouse.pm
parentc5d30320d3d120ccd291ccc7b7271400a4f20e4a (diff)
downloaddrakx-c75193289b79d4c0687aa6a597b51436568f8360.tar
drakx-c75193289b79d4c0687aa6a597b51436568f8360.tar.gz
drakx-c75193289b79d4c0687aa6a597b51436568f8360.tar.bz2
drakx-c75193289b79d4c0687aa6a597b51436568f8360.tar.xz
drakx-c75193289b79d4c0687aa6a597b51436568f8360.zip
no_comment
Diffstat (limited to 'perl-install/mouse.pm')
-rw-r--r--perl-install/mouse.pm18
1 files changed, 10 insertions, 8 deletions
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm
index 239a3de17..578765f7b 100644
--- a/perl-install/mouse.pm
+++ b/perl-install/mouse.pm
@@ -96,6 +96,7 @@ my @xmousetypes = (
sub xmouse2xId { my ($id) = @_; my $i; map_index { $_ eq $id and $i = $::i } @xmousetypes; $i }
sub names { map { $_->{FULLNAME} } @mouses }
+sub list { @mouses }
sub name2mouse {
my ($name) = @_;
@@ -109,12 +110,10 @@ sub X2nbuttons {
first(map { $_->{nbuttons} } grep { $_->{XMOUSETYPE} eq $_[0] } @mouses);
}
-sub serial_ports_names() {
- map { "ttyS" . ($_ - 1) . " / COM$_" } 1..4;
-}
-sub serial_ports_names2dev {
- local ($_) = @_;
- first(/(\w+)/);
+sub serial_ports() { map { "ttyS$_" } 0..3 }
+sub serial_port2text {
+ $_[0] =~ /ttyS (\d+)/x;
+ "$_[0] / COM" . ($1 + 1);
}
sub read($) {
@@ -179,9 +178,12 @@ sub detect() {
modules::load("mousedev");
};
sleep(2);
- if (!$@ && detect_devices::tryOpen("usbmouse")) {
+ if (!$@) {
+ my $dev;
+ $dev ||= "usbmouse" if detect_devices::tryOpen("usbmouse");
+ $dev ||= "usbmice" if detect_devices::tryOpen("usbmice");
$wacom or modules::unload("serial");
- return name2mouse("USB Mouse"), $wacom;
+ return add2hash({ device => $dev }, name2mouse("USB Mouse")), $wacom;
}
modules::unload("mousedev");
modules::unload("usbmouse");