diff options
-rw-r--r-- | perl-install/ChangeLog | 5 | ||||
-rw-r--r-- | perl-install/detect_devices.pm | 4 | ||||
-rw-r--r-- | perl-install/mouse.pm | 14 |
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") }; |