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: Fri, 08 Apr 2022 07:31:41 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> +@defvar last-event-device
>> +This variable records the name of the input device from which the last
>> +input event read was generated.  It is @code{nil} if no such device
>> +exists, i.e., the last input event was read from
>> +@code{unread-command-events}, or it came from a keyboard macro.
>> +
>> +When the X Input Extension is being used on X Windows, the device name
>> +is a string that is unique to each physical keyboard, pointing device
>> +and touchscreen attached to the X server.  Otherwise, it is either the
>> +string @samp{"Virtual core pointer"} or @samp{"Virtual core
>> +keyboard"}, depending on whether the event was generated by a pointing
>> +device (such as a mouse) or a keyboard.
>> +@end defvar
>
> Any chance we could attach this info to the events rather than storing
> them in some global var making it unclear to which event it applies?

We can't put it in the event list, i.e. key events are mostly just
characters, and can't be extended.

Which event the global variable applies to is also perfectly clear: it
applies to the last event that was read, either by the command loop or
read-event.


reply via email to

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