Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp544774imu; Sat, 15 Dec 2018 02:30:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/WZ3a0sM/4OsOv/m9i0NB+nwo1o15JmkPqQK3Yg7Ekd3RrXleT7hCmo8v8ra0udMLWWfq+Q X-Received: by 2002:a63:7d06:: with SMTP id y6mr5614352pgc.171.1544869810053; Sat, 15 Dec 2018 02:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544869810; cv=none; d=google.com; s=arc-20160816; b=JfcX6O0P6m5jPQKwYL37SloFWvg73Ck6ykz8o5fMLaIEsz7Fu0azUIevNvBzKLH4i3 1xYmb/qsZiy7B2hGm4461keMcVH8cJSvjoe9Vzv4rOaVMFis+O0+xg4oDet0jAIOkbRQ YyZv2C/qTShxuB+oAcoh6Qi324KpWBrzewZshqvOlF/63biYRy9Blc4AiG9AEzJenERG lHcfbRvyPyFhmbsTKBjs0EOb7SsCmdS4sI+7a9iO+mTRMxrjgmpv8XGvRvrQSmpGLcVG i+7RJn9xXngb0d9s+67PFP6rTqFIjg4Wxe9FoAcqEUUsqiEs9dAWdGBXOl8BqDUVvotA gIcQ== 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=OFOejzpIL6xcFlfTWoL4sS44qEjEptrdQykjzxlN++Y=; b=VojblPtZkH2kqi6JoS8aMcGTk1UBdVtI5AehYWxOaj+JmLSn7RzzygV2UvtzaHmWNv aaaGdq2w+EexmfY57qDtIZ5WxRuYG4Bbd7HIH2FawVCahGFJE0oqTz9SOzztp832MXsD tnV6av0YhIIikx6wmjKLKGdYCq4AUd8MhtigVi+v7jYIU2mB74b4f6sYG/vAZoL/fByU LJed9evESlpPQLEqjpqqa7nObA2orpkyTfsLTdIh4cxXrKUevRfzOk1uCs+cgp5LjHb6 Sc8fsmjRYCjTN9vW0YfE9tEGixwFXB68feHKM8E4IAxehd1moTzlxMJlTIk8zPwJfrXe LLyA== 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 v141si7013365pfc.260.2018.12.15.02.29.55; Sat, 15 Dec 2018 02:30:10 -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 S1730074AbeLOK3G (ORCPT + 99 others); Sat, 15 Dec 2018 05:29:06 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:46415 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728731AbeLOK3G (ORCPT ); Sat, 15 Dec 2018 05:29:06 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id BC19380990; Sat, 15 Dec 2018 11:28:59 +0100 (CET) Date: Sat, 15 Dec 2018 11:29:02 +0100 From: Pavel Machek To: Vojtech Pavlik 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: <20181215102902.GA8022@amd> References: <20181214232437.GA8310@amd> <20181215085510.GB12930@suse.com> <20181215094722.GA5804@amd> <20181215101221.GA23879@suse.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <20181215101221.GA23879@suse.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat 2018-12-15 11:12:21, Vojtech Pavlik wrote: > On Sat, Dec 15, 2018 at 10:47:22AM +0100, Pavel Machek wrote: >=20 > > > > b) would it be acceptable if done properly? (cmd line option to > > > > enable, avoiding duplicate/wrong events?) > > >=20 > > > Well, for one, you shouldn't be using a timer, all the debouncing can= be > > > done by math on the event timestamps. > >=20 > > 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. >=20 > You can send the first release and ignore all presses and releases in a > time window after that. I could, and it would work for glitches on release, but that would do very bad things if switch glitched on press, right? "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX " -> "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " ... ok "XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..." -> "XX ..." ... bad idea. [Maybe could be detected with "XX " being unusually short?] But I believe I see=20 "XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX" on X220 device, too. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlwU124ACgkQMOfwapXb+vKR/wCfcFxBeIlqKrMEK9h9TYHkH4ZF ZbkAn0Eksq6l5ksxYC9/ryTMmsG8X9MF =8YL4 -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--