From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Disabling mouse input Date: Mon, 04 Nov 2024 15:20:51 +0200 Message-ID: <86ikt3uocs.fsf@gnu.org> References: <86sesaytjn.fsf@gnu.org> <87ses7jpni.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35765"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dradetsky@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 04 14:21:35 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t7x1S-00092a-Sw for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Nov 2024 14:21:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7x1E-00007Y-RL; Mon, 04 Nov 2024 08:21:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7x11-00006Z-H0 for emacs-devel@gnu.org; Mon, 04 Nov 2024 08:21:09 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7x11-0008Su-7X; Mon, 04 Nov 2024 08:21:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=S0IMFvUkscEhPN3d3GgSWah01Ob/Ie+txiG+cTzNk6I=; b=QoLnX0FAtZne 4rJWGXe0OhslTCM9QJ3v6nL0xjfrR7WhjmPRmYiRkYs5EiA8JfU0VC6c3e85j7QMOp8dTeBROx4cC LP+RP3Spe33yIUYbsftlIcWOHaEIVoj6uPdRa9sFQIitpeFT8Qa58+xMeCGjKMaZUVQm00fO3qI94 1uq5LFKkD6Pvr50hAWZUZ92JT0IyliuwdzjYFgk/b2nOkTgyzSYzQGABPh3Yfk1hhW/bobb4BfDZd kI0n8kw6lT0H53WSAFY/jXH4Ydcf5wu76ij1fnEpdSwLCaWDr7ZVRsxFH4GGjFYrTSaYDXxMHqj6n 1ffLtLrxLyqF8KL24qZXdg==; In-Reply-To: <87ses7jpni.fsf@yahoo.com> (message from Po Lu on Mon, 04 Nov 2024 17:48:17 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325100 Archived-At: > From: Po Lu > Cc: Daniel Radetsky , Stefan Monnier > , emacs-devel@gnu.org > Date: Mon, 04 Nov 2024 17:48:17 +0800 > > Eli Zaretskii writes: > > > Thanks, but this is not enough, and I also think it doesn't > > necessarily ignore the mouse events on the right level. We should > > instead ignore these events where they are read, here: > > > > /* No need for FIONREAD or fcntl; just say don't wait. */ > > while ((nr = (*t->read_socket_hook) (t, &hold_quit)) > 0) > > nread += nr; > > > > This loop should ignore and remove from the queue any events whose > > 'kind' (as declared in termhooks.h) is a mouse or touchpad event. And > > perhaps we also should allow ignoring the latter, but not the former. > > Otherwise, the "ignored" input events will act like ghosts: they do > > exist in the queue, and do trigger input-even related mechanisms we > > have, such as while-no-input, but cannot be accessed. > > > > Stefan, Po Lu (and others), do you agree? > > I agree, and it's probably also a good idea to abort any key sequence > involving down-mouse-1 events if this option should be enabled during > them. If we filter mouse events in the above loop, down-mouse-1 etc. will also be filtered, no? > > In addition, we'd need to change display-mouse-p, so that it reflects > > the fact that mouse clicks are not available. Otherwise, some > > features will present mouse-driven UI that cannot be used. > > Though I confess to not having read enough of this conversation to > understand why this option is useful. Surely it must be more difficult > to control Emacs with one input device than with two. The rationale is to avoid unintended mouse moves and touchpad touches from affecting Emacs.