emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 3b41141708: Expose the name of an event's input device to Lis


From: Po Lu
Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp
Date: Sun, 10 Apr 2022 14:17:46 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Then the events emitted by those buttons which are not part of the
> device will not be emitted.
>
> Or maybe I misunderstand what you have in mind when you say "the
> buttons we want to change are not part of the device".

I wanted to say that the buttons belong to different instances of the
same kind of device (ordinary computer mice).

> If these events are different, they should have different symbols,
> yes.  How is this different from, say, mouse-6, which only appears
> when you have a mouse with 6 or more buttons, although commands can be
> bound to mouse-6 even if such a mouse isn't available?

These events are the same aside from the device that generated them, the
only difference is that we want the same event to be treated differently
based on such a fact.

> We've been through this: the second mouse should have its buttons
> numbered starting from some number N to distinguish it from the first.
> For example, N could be 11, so the buttons are mouse-11, mouse-12,
> etc.

How do you decide which mouse is the "second mouse"?

> Display capabilities are tested as preconditions for producing some
> fancy effect on display, not for dispatch on input events.  If we
> don't test the display for some capability, trying to produce the
> related display effect is likely to signal an error, which is not
> useful.
>
> Besides, even if the display-capability analogy is actually an
> argument against your design: we test generic capabilities, not the
> names of the display terminal on which Emacs shows its frames.

Hmm, then I suppose a better anology would be
`overriding-terminal-local-map'.  If I connect the second mouse to a
different X display, I can make input from that mouse behave differently
by changing the keymap for the terminal associated with that other
display.

Why shouldn't I be able to do that with the second mouse when it is
connected to the same X display as the first mouse?

Thanks.

> That is a separate issue, not the one I was talking about.  If there
> needs to be some Lisp executed, once, when the (second) keyboard is
> attached to Emacs, or when we switch to another type of keyboard, and
> if that cannot be done automatically (e.g., by Emacs listening to some
> special system event or polling some port), then so be it.  But from
> that point onwards, the key input on the Lisp level doesn't need to
> know about the keyboard devices, perhaps not even that there's more
> than one keyboard.

I will give this some more thought.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]