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: Mon, 11 Apr 2022 09:02:07 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

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

> That means all users of `register-device-function-key` need to write
> their code under the assumption that the actual "function key" (I'd
> call it a "prefix event" rather than a "function key") is not the one
> they asked for but the one returned, which ends up being the same as
> dynamically-generated "function keys".
>
> It makes it rather inconvenient to use for the end user who wants to
>
>     (define-key map [foot-pedal ?b] 'foo)
>
> and has to do
>
>     (define-key map (vector (register-device-function-key <blabla>) ?b) 'foo)
>
> instead.
>
> I hope we will settle over time on some naming convention so that
> conflicting names almost never happen and `register-device-function-key`
> can presume the caller knows what it does, so instead of returning the
> previously chosen name, it doesn't return anything and overrides the old
> name instead.

Or alternatively we could allow the function key/prefix event to be
something other than a symbol:

  (define-key map ["Lars' foot pedal" ?b) #'foo)

would make events coming from the device named "Lars' foot pedal" go to
"foo", and

  (define-key map [[eraser] mouse-1] #'artist-erase-drag)

would make events coming from an eraser run "artist-erase-drag".

But I'm not sure how much work that would be.  I think we will new
syntax for that in `kbd', at the very least.


reply via email to

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