From: James Cherti <contact@jamescherti.com>
To: emacs-devel@gnu.org
Subject: Re: Disabling mouse input
Date: Sat, 2 Nov 2024 10:32:37 -0400 [thread overview]
Message-ID: <a1b3aaeb-a87c-45e6-ae51-62cf3d0357d0@jamescherti.com> (raw)
In-Reply-To: <jwv5xp5ep69.fsf-monnier+emacs@gnu.org>
Your code snippet provides an interesting solution. Thank you for
sharing it, Stefan.
--
James Cherti
https://www.jamescherti.com/
On 2024-11-02 09:38, Stefan Monnier 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.
> My first intuition would be to do something like:
>
> (define-key input-decode-map [wheel-down] (lambda (_prompt) []))
> (define-key input-decode-map [wheel-up] (lambda (_prompt) []))
> (define-key input-decode-map [mouse-1] (lambda (_prompt) []))
> (define-key input-decode-map [mouse-2] (lambda (_prompt) []))
> (define-key input-decode-map [mouse-3] (lambda (_prompt) []))
>
> If that works, then you'll probably want to add more bindings for those
> cases where you hit the "mouse" while holding a modifier, i.e. something like:
>
> (dolist (modifier '(control meta nil))
> (dolist (base '(wheel-down wheel-up mouse-1 mouse-2 mouse-3))
> (define-key input-decode-map
> (vector (event-convert-list (list modifier base)))
> (lambda (_prompt) []))))
>
>
> - Stefan
>
>
next prev parent reply other threads:[~2024-11-02 14:32 UTC|newest]
Thread overview: 27+ 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
2024-11-02 12:04 ` Eli Zaretskii
2024-11-02 13:38 ` Stefan Monnier
2024-11-02 14:32 ` James Cherti [this message]
2024-11-02 16:30 ` Dov Grobgeld
2024-11-02 16:43 ` Stefan Monnier
2024-11-02 17:07 ` tomas
2024-11-03 12:34 ` James Cherti
2024-11-03 12:47 ` tomas
2024-11-02 16:50 ` Eli Zaretskii
2024-11-02 16:54 ` Stefan Monnier
2024-11-02 16:59 ` Eli Zaretskii
2024-11-02 17:04 ` Stefan Monnier
2024-11-02 17:40 ` Eli Zaretskii
2024-11-02 18:11 ` Stefan Monnier
2024-11-02 18:32 ` Eli Zaretskii
2024-11-02 23:09 ` Daniel Radetsky
2024-11-03 1:56 ` Stefan Monnier
2024-11-03 7:54 ` Daniel Radetsky
2024-11-03 14:01 ` James Cherti
2024-11-04 9:48 ` Po Lu
2024-11-04 13:20 ` Eli Zaretskii
2024-11-02 13:17 ` James Cherti
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a1b3aaeb-a87c-45e6-ae51-62cf3d0357d0@jamescherti.com \
--to=contact@jamescherti.com \
--cc=emacs-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.