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 11:30:47 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Brian Cully <bjc@spork.org> writes:

>       This is what’s not clear to me. Is Lisp code that’s shipping as
> part of the standard Emacs distribution making this classification, or
> am I doing it in my user customizations?

Your user customizations and hopefully some of the standard code as well
(pixel-scroll-precision-mode comes to mind.)

Let me try to explain: your adaptable USB mouse might be configured to
send coarse wheel events.  In that case, Emacs gets an ordinary
wheel-down/wheel-up event without any precision scrolling information.

Now, the device class will probably show up as a "mouse" as well, so
Emacs knows it is configured as a mouse that is configured to scroll by
lines.

But if you set it up to send detailed valuator information, then Emacs
will know it's a mouse configured with precision scrolling information,
and then scroll in an interpolated fashion.

>       My understanding is that X (and Wayland) pull their
> classification from evdev/libinput, which itself pulls from the HID
> descriptors. The name of the device doesn’t figure, except for things
> like desktop input settings panels, as a way to differentiate devices.

X doesn't "pull" its classifications from anything.  The individual
input drivers are supposed to put it in the name and device properties,
and then toolkits are determine what it is based on that.

Since device properties are very input driver dependent and don't help
to uniquely identify a device, we use the name instead.

Wayland is different: it includes the classification inside the devices
in each seat.  So Emacs simply includes that classification in the name,
and `device-class' returns that directly.

(But it's too early to talk about how exactly Wayland will end up doing
things, since aside from keyboards, mice and touchscreens the rest of
the required protocol extensions are not stable yet.)

>       I can (and do!) change how some of my USB devices present
> themselves without changing their names. I’ve never had any kind of
> issue, so I’m not sure why the name would be considered important
> information in terms of classification.

You don't have to change their names, the device drivers and input
extension do whenever appropriate.  But I suspect that your device does
not cause a change in any sort of "classification", instead it just
generates different input events based on what it is currently
configured to do, in which case you should see above.

Thanks.


reply via email to

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