From 9464c99ce230957dd3adbedacc3d4db1ed740179 Mon Sep 17 00:00:00 2001 From: Shea Levy <shea@shealevy.com> Date: Mon, 8 Aug 2011 01:34:36 +0000 Subject: [PATCH] First attempt at a multitouch touchpad module. Note that the Multitouch X Driver currently has no configuration beyond editing the source code, so the only option is enable or disable svn path=/nixos/trunk/; revision=28373 --- modules/services/x11/hardware/multitouch.nix | 63 +++----------------- 1 file changed, 9 insertions(+), 54 deletions(-) diff --git a/modules/services/x11/hardware/multitouch.nix b/modules/services/x11/hardware/multitouch.nix index 9328dbbad6c..a51e29f0e8f 100644 --- a/modules/services/x11/hardware/multitouch.nix +++ b/modules/services/x11/hardware/multitouch.nix @@ -2,78 +2,33 @@ with pkgs.lib; -let cfg = config.services.xserver.synaptics; in - { options = { - services.xserver.synaptics = { - + services.xserver.multitouch = { + enable = mkOption { default = false; example = true; - description = "Whether to enable touchpad support."; - }; - - dev = mkOption { - default = null; - example = "/dev/input/event0"; - description = - '' - Path for touchpad device. Set to null to apply to any - auto-detected touchpad. - ''; - }; - - minSpeed = mkOption { - default = "0.6"; - description = "Cursor speed factor for precision finger motion."; - }; - - maxSpeed = mkOption { - default = "1.0"; - description = "Cursor speed factor for highest-speed finger motion."; - }; - - twoFingerScroll = mkOption { - default = false; - description = "Whether to enable two-finger drag-scrolling."; - }; - - vertEdgeScroll = mkOption { - default = true; - description = "Whether to enable vertical edge drag-scrolling."; + description = "Whether to enable multitouch touchpad support."; }; }; }; + config = mkIf config.services.xserver.multitouch.enable { - config = mkIf cfg.enable { - - services.xserver.modules = [ pkgs.xorg.xf86inputsynaptics ]; + services.xserver.modules = [ pkgs.xorg.xf86_input_multitouch ]; services.xserver.config = '' - # Automatically enable the synaptics driver for all touchpads. + # Automatically enable the multitouch driver Section "InputClass" - Identifier "synaptics touchpad catchall" - MatchIsTouchpad "on" - ${optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''} - Driver "synaptics" - Option "MaxTapTime" "180" - Option "MaxTapMove" "220" - Option "MinSpeed" "${cfg.minSpeed}" - Option "MaxSpeed" "${cfg.maxSpeed}" - Option "AccelFactor" "0.0010" - Option "TapButton1" "1" - Option "TapButton2" "2" - Option "TapButton3" "3" - Option "VertTwoFingerScroll" "${if cfg.twoFingerScroll then "1" else "0"}" - Option "HorizTwoFingerScroll" "${if cfg.twoFingerScroll then "1" else "0"}" - Option "VertEdgeScroll" "${if cfg.vertEdgeScroll then "1" else "0"}" + MatchIsTouchpad "true" + Identifier "Multitouch Touchpad" + Driver "multitouch" EndSection '';