From 3d2b83c110c581aff72978e45b237e3aea28ef51 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sat, 14 Jul 2012 21:40:49 -0400 Subject: [PATCH] multitouch: Add an option to ignore palm touches --- modules/services/x11/hardware/multitouch.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/services/x11/hardware/multitouch.nix b/modules/services/x11/hardware/multitouch.nix index 35e30ccf76b..ea51a4fc55b 100644 --- a/modules/services/x11/hardware/multitouch.nix +++ b/modules/services/x11/hardware/multitouch.nix @@ -2,6 +2,8 @@ with pkgs.lib; +let cfg = config.services.xserver.multitouch; in + { options = { @@ -21,11 +23,18 @@ with pkgs.lib; description = "Whether to invert scrolling direction à la OSX Lion"; }; + ignorePalm = mkOption { + default = false; + example = true; + type = types.bool; + description = "Whether to ignore touches detected as being the palm (i.e when typing)"; + }; + }; }; - config = mkIf config.services.xserver.multitouch.enable { + config = mkIf cfg.enable { services.xserver.modules = [ pkgs.xf86_input_mtrack ]; @@ -36,7 +45,8 @@ with pkgs.lib; MatchIsTouchpad "on" Identifier "Touchpads" Driver "mtrack" - ${optionalString config.services.xserver.multitouch.invertScroll '' + Option "IgnorePalm" "${if cfg.ignorePalm then "true" else "false"}" + ${optionalString cfg.invertScroll '' Option "ScrollUpButton" "5" Option "ScrollDownButton" "4" ''}