From: Daniel Radetsky <dradetsky@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
Po Lu <luangruo@yahoo.com>,
emacs-devel@gnu.org
Subject: Re: Disabling mouse input
Date: Sat, 2 Nov 2024 03:17:39 -0700 [thread overview]
Message-ID: <4p6cs2adzzqihjdustvlklr3ykrrz7eq7rtz2ciywcyevgmoej@klyfgnsjtnti> (raw)
In-Reply-To: <86sesaytjn.fsf@gnu.org>
On Sat, Nov 02, 2024 at 09:38:20AM GMT, Eli Zaretskii wrote:
> (This should not surprise anyone, because input events are handled in
> C, not in Lisp, and so disabling this in Lisp is expected to be
> impossible.)
Well, everyone I talked to was sure it must be possible in
Lisp, so I figured somebody would ask eventually.
> 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:
It was clearly enough for you to tell me I was doing it the
Stupid Way, which was my objective, so I don't see the
problem. I mean, obviously you're not going to merge what I
sent. That wasn't the point.
> 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.
Sounds reasonable. I'll take another look soon.
> 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.
I can't tell if this issue is supposed to be a consequence
of not implementing ignore-touchpad-but-not-mouse, or of
ignoring the events the way I was doing it (via the goto in
read_key_sequence).
> 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.
Good point. I'm thoroughly ignorant of emacs' mouse-driven UI.
> > + DEFVAR_LISP ("ignore-mouse-input", ignore_mouse_input,
> > + doc: /* If non-nil, discard mouse input in the command loop */);
> > + ignore_mouse_input = Qnil;
>
> This should be DEFVAR_BOOL instead.
Okay, wasn't certain about that.
It was also suggested to me that other devs would want the
feature exposed via a global minor mode, not just a
variable. Do you? I looked into it and it was about 10 lines
of Lisp (most of which was to allow it to be set via
customize), so that's not a big deal if so. Or I mean
probably not; maybe I'll discover it's much worse in
practice once I know what's actually involved.
Thanks for the info.
next prev parent reply other threads:[~2024-11-02 10:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-02 2:01 Disabling mouse input Daniel Radetsky
2024-11-02 2:44 ` Corwin Brust
2024-11-02 3:07 ` Daniel Radetsky
2024-11-02 7:38 ` Eli Zaretskii
2024-11-02 10:17 ` Daniel Radetsky [this message]
2024-11-02 12:04 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4p6cs2adzzqihjdustvlklr3ykrrz7eq7rtz2ciywcyevgmoej@klyfgnsjtnti \
--to=dradetsky@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).