diff options
author | Francois Pons <fpons@mandriva.com> | 2001-08-30 15:24:50 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-08-30 15:24:50 +0000 |
commit | 72810b5b86c49a2bb6bd8c37030494a38261407c (patch) | |
tree | a5285e11d0dd575ecafe0247e2f7bfe7f26a11f0 /perl-install/mouse.pm | |
parent | 3823744270e150c84589a521927c112f9afb2c73 (diff) | |
download | drakx-72810b5b86c49a2bb6bd8c37030494a38261407c.tar drakx-72810b5b86c49a2bb6bd8c37030494a38261407c.tar.gz drakx-72810b5b86c49a2bb6bd8c37030494a38261407c.tar.bz2 drakx-72810b5b86c49a2bb6bd8c37030494a38261407c.tar.xz drakx-72810b5b86c49a2bb6bd8c37030494a38261407c.zip |
fix previous fixes on mouse::write_conf
Diffstat (limited to 'perl-install/mouse.pm')
-rw-r--r-- | perl-install/mouse.pm | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm index 821bf8bd7..68f70b0ae 100644 --- a/perl-install/mouse.pm +++ b/perl-install/mouse.pm @@ -342,9 +342,9 @@ sub write_conf { my ($mouse) = @_; my ($zaxis, $zaxis_aux) = map { [ - $mouse->{nbuttons} > 3 ? [ "ZAxisMapping", "4 5" ] : (), - $mouse->{nbuttons} > 5 ? [ "ZAxisMapping", "6 7" ] : (), - $mouse->{nbuttons} < 3 ? ([ "Emulate3Buttons" ], [ "Emulate3Timeout", "50" ]) : () + $_->{nbuttons} > 3 ? [ "ZAxisMapping", "4 5" ] : (), + $_->{nbuttons} > 5 ? [ "ZAxisMapping", "6 7" ] : (), + $_->{nbuttons} < 3 ? ([ "Emulate3Buttons" ], [ "Emulate3Timeout", "50" ]) : () ] } grep { $_ } ($mouse, $mouse->{auxmouse}); my ($str_zaxis, $str_zaxis_aux) = map { join('', map { qq(\n $_->[0]) . ($_->[1] && qq( $_->[1])) } @$_) @@ -357,7 +357,7 @@ sub write_conf { s|^(\s*Device\s+).*|$1"/dev/$mouse->{device}"$str_zaxis|; } if ($mouse->{auxmouse}) { - if (/^DeviceName\s+"Mouse2"/ .. /^EndSection/) { + if (/DeviceName\s+"Mouse2"/ .. /^EndSection/) { $found_auxmouse = 1; $_ = '' if /(ZAxisMapping|Emulate3)/; #- remove existing line s|^(\s*Protocol\s+).*|$1"$mouse->{auxmouse}{XMOUSETYPE}"|; @@ -366,13 +366,14 @@ sub write_conf { } } $f if -e $f && !$::testing; substInFile { - if (/^Section\s+"Pointer"/ .. /^EndSection/ && /^EndSection/) { - $_ .= qq( + if (my $l = /^Section\s+"Pointer"/ .. /^EndSection/) { + $l =~ /E/ and $_ .= qq( Section "XInput" SubSection "Mouse" - Protocol "$mouse->{auxmouse}{XMOUSETYPE}" - Device "/dev/$mouse->{auxmouse}{device}"$str_zaxis_aux + DeviceName "Mouse2" + Protocol "$mouse->{auxmouse}{XMOUSETYPE}" + Device "/dev/$mouse->{auxmouse}{device}"$str_zaxis_aux EndSubSection EndSection ); @@ -385,25 +386,26 @@ EndSection substInFile { if (/Identifier\s+"Mouse1"/ .. /^EndSection/) { $_ = '' if /(ZAxisMapping|Emulate3)/; #- remove existing line - s|^(\s*Option\s+"Protocol"\s+).*|$1"$mouse->{XMOUSETYPE}"|; + s|^(\s*Option\s+"Protocol"\s+).*|$1"$mouse->{XMOUSETYPE}"|; #" s|^(\s*Option\s+"Device"\s+).*|$1"/dev/mouse"$str_zaxis|; } if ($mouse->{auxmouse}) { if (/Identifier\s+"Mouse2"/ .. /^EndSection/) { + $found_auxmouse = 1; $_ = '' if /(ZAxisMapping|Emulate3)/; #- remove existing line - s|^(\s*Option\s+"Protocol"\s+).*|$1"$mouse->{auxmouse}{XMOUSETYPE}"|; - s|^(\s*Option\s+"Device"\s+).*|$1"/dev/$mouse->{auxmouse}{device}"$str_zaxis_aux|; + s|^(\s*Option\s+"Protocol"\s+).*|$1"$mouse->{auxmouse}{XMOUSETYPE}"|; #" + s|^(\s*Option\s+"Device"\s+).*|$1"/dev/$mouse->{auxmouse}{device}"$str_zaxis_aux|; #" } } } $g if -e $g && !$::testing; - subsInFile { - if (/Identifier\s+"Mouse1"/ .. /^EndSection/ && /^EndSection/) { - $_ .= qq( + substInFile { + if (my $l = /Identifier\s+"Mouse1"/ .. /^EndSection/) { + $l =~ /E/ and $_ .= qq( Section "InputDevice" Identifier "Mouse2" - Option "Protocol" "$mouse->{auxmouse}{XMOUSETYPE}" - Option "Device" "/dev/$mouse->{auxmouse}{XMOUSETYPE}"$str_zaxis_aux + Option "Protocol" "$mouse->{auxmouse}{XMOUSETYPE}" + Option "Device" "/dev/$mouse->{auxmouse}{XMOUSETYPE}"$str_zaxis_aux EndSection ); } |