summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorAdam Lebsack <adam@mandriva.com>2000-03-02 15:28:05 +0000
committerAdam Lebsack <adam@mandriva.com>2000-03-02 15:28:05 +0000
commit2ed60ec380371c720c59e8bc0f70d68489deb116 (patch)
treeba2f74812577763b4dbb2f9cc245ab2f6b0f6eab /perl-install
parenta912981cf2c3cffc0dd85dc0f625da54e83e0e6c (diff)
downloaddrakx-2ed60ec380371c720c59e8bc0f70d68489deb116.tar
drakx-2ed60ec380371c720c59e8bc0f70d68489deb116.tar.gz
drakx-2ed60ec380371c720c59e8bc0f70d68489deb116.tar.bz2
drakx-2ed60ec380371c720c59e8bc0f70d68489deb116.tar.xz
drakx-2ed60ec380371c720c59e8bc0f70d68489deb116.zip
Added some stuff to detect the mouse on mac hardware. changed files: mouse.pm
and detect_devices.pm. See changelog.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/ChangeLog5
-rw-r--r--perl-install/detect_devices.pm4
-rw-r--r--perl-install/mouse.pm14
3 files changed, 23 insertions, 0 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index 44ac3f18d..25d356c97 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,3 +1,8 @@
+2000-03-02 Adam Lebsack <adam@mandrakesoft.com>
+
+ * mouse.pm: added mac mouse detection to mouse::detect.
+ * detect_devices.pm: added a routine to probe /dev/usbmouse on macs.
+
2000-03-01 François Pons <fpons@mandrakesoft.com>
* *.pm: heavy modification to take into account smaller
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index ba0765fb5..c1333f34e 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -243,6 +243,10 @@ sub hasMousePS2() {
my $t; sysread(tryOpen("psaux") || return, $t, 256) != 1 || $t ne "\xFE";
}
+sub hasMouseMacUSB {
+ my $t; sysread(tryOpen("usbmouse") || return, $t, 256) != 1 || $t ne "\xFE";
+}
+
#-######################################################################################
#- Wonderful perl :(
#-######################################################################################
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm
index 7afe9fa97..8bf898d5a 100644
--- a/perl-install/mouse.pm
+++ b/perl-install/mouse.pm
@@ -19,6 +19,13 @@ my @mouses_fields = qw(nbuttons device MOUSETYPE XMOUSETYPE FULLNAME);
my @mouses = (
arch() =~ /^sparc/ ? (
[ 3, "sunmouse", "sun", "sun", __("Sun - Mouse") ],
+) : arch() eq "ppc" ? (
+ [ 1, "adbmouse", "Busmouse", "BusMouse", __("Apple ADB Mouse") ],
+ [ 2, "adbmouse", "Busmouse", "BusMouse", __("Apple ADB Mouse (2 Buttons)") ],
+ [ 3, "adbmouse", "Busmouse", "BusMouse", __("Apple ADB Mouse (3+ Buttons)") ],
+ [ 1, "usbmouse", "imps2", "IMPS/2", __("Apple USB Mouse") ],
+ [ 2, "usbmouse", "imps2", "IMPS/2", __("Apple USB Mouse (2 Buttons)") ],
+ [ 3, "usbmouse", "imps2", "IMPS/2", __("Apple USB Mouse (3+ Buttons)") ],
) : (
[ 2, "psaux", "ps/2", "PS/2", __("Generic Mouse (PS/2)") ],
[ 3, "psaux", "ps/2", "PS/2", __("Logitech MouseMan/FirstMouse (ps/2)") ],
@@ -115,6 +122,13 @@ sub mouseconfig {
sub detect() {
return name2mouse("Sun - Mouse") if arch() =~ /^sparc/;
+ if (arch() eq"ppc") {
+ return name2mouse("Apple USB Mouse") if detect_devices::hasMouseMacUSB;
+ # No need to search for an ADB mouse. If I did, the PPC kernel would
+ # find one whether or not I had one installed! So.. default to it.
+ return name2mouse("Apple ADB Mouse");
+ }
+
detect_devices::hasMousePS2 and return name2mouse("Generic Mouse (PS/2)");
eval { commands::modprobe("serial") };