diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/Xconfig/xfree.pm | 41 | ||||
-rw-r--r-- | perl-install/mouse.pm | 37 |
2 files changed, 71 insertions, 7 deletions
diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm index 680189915..3f18b5f9e 100644 --- a/perl-install/Xconfig/xfree.pm +++ b/perl-install/Xconfig/xfree.pm @@ -210,6 +210,47 @@ sub set_wacoms { ################################################################################ +# synaptics #################################################################### +################################################################################ +sub set_synaptics { + my ($raw_X, @synaptics) = @_; + $raw_X->remove_InputDevices('synaptics'); + + my $layout = get_ServerLayout($raw_X)->{InputDevice} ||= []; + @$layout = grep { $_->{val} !~ /^"Synaptics Mouse/ } @$layout; + + @synaptics or return; + add_load_module($raw_X, "synaptics"); + + each_index { + my $synaptics_mouse = $_; + my $identifier = "SynapticsMouse" . ($::i + 1); + my $pointer_type = $synaptics_mouse->{Primary} ? "CorePointer" : "AlwaysCore"; + my $h = { Identifier => { val => $identifier }, + Driver => { val => "synaptics" }, + Device => { val => $synaptics_mouse->{Device}, Option => 1 }, + Protocol => { val => $synaptics_mouse->{Protocol}, Option => 1 }, + LeftEdge => { val => 1700, Option => 1 }, + RightEdge => { val => 5300, Option => 1 }, + TopEdge => { val => 1700, Option => 1 }, + BottomEdge => { val => 4200, Option => 1 }, + FingerLow => { val => 25, Option => 1 }, + FingerHigh => { val => 30, Option => 1 }, + MaxTapTime => { val => 180, Option => 1 }, + MaxTapMove => { val => 220, Option => 1 }, + VertScrollDelta => { val => 100, Option => 1 }, + MinSpeed => { val => 0.06, Option => 1 }, + MaxSpeed => { val => 0.12, Option => 1 }, + AccelFactor => { val => 0.0010, Option => 1 }, + SHMConfig => { val => "on", Option => 1 }, + }; + $raw_X->add_Section('InputDevice', $h); + push @$layout, { val => qq("$identifier" "$pointer_type") }; + } @synaptics; +} + + +################################################################################ # monitor ###################################################################### ################################################################################ my @monitor_fields = qw(VendorName ModelName HorizSync VertRefresh); diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm index 2f1cd6b29..415600bec 100644 --- a/perl-install/mouse.pm +++ b/perl-install/mouse.pm @@ -32,9 +32,9 @@ my %mice = [ 5, 'ps/2', 'MouseManPlusPS/2', N_("Logitech MouseMan+") ], [ 5, 'imps2', 'IMPS/2', N_("Generic PS2 Wheel Mouse") ], [ 5, 'ps/2', 'GlidePointPS/2', N_("GlidePoint") ], - if_(c::kernel_version() !~ /^\Q2.6/, - [ 5, 'imps2', 'auto', N_("Automatic") ], - ), + c::kernel_version() =~ /^\Q2.6/ ? + [ 5, 'ps/2', 'auto-dev', N_("Synaptics Touchpad") ] : + [ 5, 'imps2', 'auto', N_("Automatic") ], '', [ 5, 'ps/2', 'ThinkingMousePS/2', N_("Kensington Thinking Mouse") ], [ 5, 'netmouse', 'NetMousePS/2', N_("Genius NetMouse") ], @@ -288,8 +288,16 @@ sub detect { if (c::kernel_version() =~ /^\Q2.6/) { $modules_conf->get_probeall("usb-interface") and eval { modules::load('usbhid') }; - if (cat_('/proc/bus/input/devices') =~ /^H: Handlers=mouse/m) { - return fullname2mouse('Universal|Any PS/2 & USB mice', wacom => \@wacom); + my @input_devices = cat_('/proc/bus/input/devices'); + my $synaptics_mouse; + if (my $mouse_nb = grep { /^H: Handlers=mouse/ } @input_devices) { + my $univ_mouse = fullname2mouse('Universal|Any PS/2 & USB mice', wacom => \@wacom); + if (any { m!^N: Name="(?:SynPS/2 Synaptics TouchPad|AlpsPS/2 ALPS TouchPad)"$! } @input_devices) { + $synaptics_mouse = fullname2mouse('PS/2|Synaptics Touchpad'); + $mouse_nb < 2 and return $synaptics_mouse; + $univ_mouse->{auxmouse} = $synaptics_mouse; + } + return $univ_mouse; } } else { my $ps2_mouse = detect_devices::hasMousePS2("psaux") && fullname2mouse("PS/2|Automatic", unsafe => 0); @@ -346,12 +354,17 @@ sub load_modules { /ttyS/ and push @l, qw(serial); /event/ and push @l, qw(wacom evdev); } + if (member(N_("Synaptics Touchpad"), $mouse->{name}, $mouse->{auxmouse}{name})) { + push @l, qw(evdev); + } eval { modules::load(@l) }; } sub set_xfree_conf { my ($mouse, $xfree_conf, $b_keep_auxmouse_unchanged) = @_; - + + my ($synaptics, $mouse_) = partition { $_->{name} eq N_("Synaptics Touchpad") } + @{[ $mouse, if_($mouse->{auxmouse}, $mouse->{auxmouse}) ]}; my @mice = map { { Protocol => $_->{XMOUSETYPE}, @@ -360,7 +373,7 @@ sub set_xfree_conf { if_($_->{nbuttons} < 3, Emulate3Buttons => undef, Emulate3Timeout => 50), if_($_->{EMULATEWHEEL}, Emulate3Buttons => undef, Emulate3Timeout => 50, EmulateWheel => undef, EmulateWheelButton => 2), }; - } ($mouse, if_($mouse->{auxmouse}, $mouse->{auxmouse})); + } @$mouse_; if (!$mouse->{auxmouse} && $b_keep_auxmouse_unchanged) { my (undef, @l) = $xfree_conf->get_mice; @@ -372,6 +385,12 @@ sub set_xfree_conf { if (my @wacoms = @{$mouse->{wacom} || []}) { $xfree_conf->set_wacoms(map { { Device => "/dev/$_", USB => m|input/event| } } @wacoms); } + + $synaptics and $xfree_conf->set_synaptics(map { { + Device => "/dev/$_->{device}", + Protocol => $_->{XMOUSETYPE}, + Primary => $_ ne $mouse->{auxmouse}, + } } @$synaptics); } sub various_xfree_conf { @@ -394,6 +413,10 @@ sub various_xfree_conf { output_with_perm($f, 0755, "xinput set-button-map Mouse2 1 2 3 6 7 4 5\n"); } } + + if (member(N_("Synaptics Touchpad"), $mouse->{name}, $mouse->{auxmouse}{name})) { + $do_pkgs->install("synaptics"); + } } #- write_conf : write the mouse infos into the Xconfig files. |