Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp533501imu; Sat, 15 Dec 2018 02:13:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/V7i3hCkGlmjfB56vCZ78M3N9yLn0L08QmRMaz8yoIBn9cZq0N8qKYpgXEVSljyzXNL0bC3 X-Received: by 2002:a17:902:6b83:: with SMTP id p3mr5913337plk.118.1544868817994; Sat, 15 Dec 2018 02:13:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544868817; cv=none; d=google.com; s=arc-20160816; b=w3QERvIwhYZgzm86dAg1catLmyL9W7IfXZzAlqjv284EW7U8620unnbfBhoB7tBmoO 0nD6CJ/0rf2KW9eIGWie+28iccaCYb4DKPklkGSyKxxrPi4B1kxmLOE8hTvzSnJRwKRR M5lTBdjMhztI+Rd6/MOuq04ePPzGO5XSIM/CiyvJTQp5p5mSHx+pRvQ4Hdd9y1PPXCef RYm/fKzm+Bgr2rcsDk5lW2ui9BZzTcDRfL3UDPLBmnoToSgRrGNXPtRHuy5QM59pLQYP IQSQKAjH0kXsX+6r4R9CNzuSNdmujDVBBXq7WZeO2S1IvXeCFBQs20sE1P/e+NkvgbJZ 6K/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=1PTnnJC/ZjglhvBNminzHFdLyXyUpu4GzH/87McWOI0=; b=MgBfpR0dRAhxicABYyfUXb8H5mbI2nI4LZKgxXztyuRl30IcWDwhc1UJ67RGp5OeZk 1/XYN2t2LF5zmorQFPjy6iUGFmmGxT+wQk50/gQGopVk2bHliGDYzrEhy7a7LlY+XEdr l6UHCM6+bQ7jlCZlnM3zFUHeoGzSv8qZpW3hS5bzZzINo8+K1Dv3AoMLMzjHBInp1J97 6HggyTvf2m7s1Z9zQRCWs0KkwT5NbRFuqL08hUFcKaBKNsENXPTOO9P9DmCkJLXMwRHu L1drTKfPgPZv7T0JSq5sgVWv/EDPczuTrMK481anw9t67cl8AYXrkgKUz1SSfVUTkcT/ nu4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si5985906pgl.25.2018.12.15.02.13.20; Sat, 15 Dec 2018 02:13:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729966AbeLOKMY (ORCPT + 99 others); Sat, 15 Dec 2018 05:12:24 -0500 Received: from jablonecka.jablonka.cz ([91.219.244.36]:49891 "EHLO jablonecka.jablonka.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729077AbeLOKMX (ORCPT ); Sat, 15 Dec 2018 05:12:23 -0500 Received: from twilight.vojtech.kobylisy.czf (unknown [10.32.148.9]) by jablonecka.jablonka.cz (Postfix mail delivery) with ESMTP id DE0B8603494B; Sat, 15 Dec 2018 11:12:21 +0100 (CET) Received: by twilight.vojtech.kobylisy.czf (Postfix, from userid 1000) id C35B71549C37; Sat, 15 Dec 2018 11:12:21 +0100 (CET) Date: Sat, 15 Dec 2018 11:12:21 +0100 From: Vojtech Pavlik To: Pavel Machek Cc: kernel list , jikos@suse.cz, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Subject: Re: [rfd] saving old mice -- button glitching/debouncing Message-ID: <20181215101221.GA23879@suse.com> References: <20181214232437.GA8310@amd> <20181215085510.GB12930@suse.com> <20181215094722.GA5804@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181215094722.GA5804@amd> X-Bounce-Cookie: It's a lemon tree, dear Watson! User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 15, 2018 at 10:47:22AM +0100, Pavel Machek wrote: > > > b) would it be acceptable if done properly? (cmd line option to > > > enable, avoiding duplicate/wrong events?) > > > > Well, for one, you shouldn't be using a timer, all the debouncing can be > > done by math on the event timestamps. > > Not... really, right? You need to send an release some time after > button indicates release if bounce did not happen. It is similar to > autorepeat needing a timer. You can send the first release and ignore all presses and releases in a time window after that. > Let me gain some experience with the patch. I don't think hardware > does as heavy debouncing as you describe. Microswitches vibrate significantly when clicked. Without hardware debouncing, you'd have many clicks instead of one even on a new mouse. -- Vojtech Pavlik