GNU bug report logs -
#74423
Low level key events
Previous Next
Full log
View this message in rfc822 format
On 19/11/2024 17:43, Stefan Monnier wrote:
>> + ((functionp func) (funcall func))
>> + ((eq 'hyper func)
>> + (message "H-...")
>> + (let ((r (read-event)))
>> + (setq unread-command-events
>> + (list (event-apply-modifier
>> + r 'hyper 24 "H-"))))))))))
>
> Move that code to a function, so you can get rid of this `hyper`
> special case. BTW, any reason why you couldn't use
> `event-apply-hyper-modifier`?
No, no reason. I will change that.
> I think the list of low-level keys handled here should not be hard-coded.
> IOW, maybe `enable-low-level-keys` should not be a boolean but
> a list/map/table indicating which keys to handle.
I was sending the keys for which I have an immediate use case. Using a
list looks got, adding some special symbols to choose groups, such as
"all modifier keys".
> So, IIUC you might generate 2 low-level events for a single key press?
> Why?
We want to allow to detect modifier keys, regardless of the key that is
used. For example, when you press Shift_L we generate an event for
'lshift and other (of different type) for the modifier 'shift.
> Other note: in the distant past (back around Emacs-21) I seem to
> remember Gerd making changes to the event structure so as to avoid
> allocating Lisp objects for this code. I think it was related to
> problems due to running this low-level event-handler code from within
> a C signal handler, which is a practice was have since stopped, luckily,
> but maybe there are still good reasons to try and avoid involving
> allocating objects into the Lisp heap in this low-level code.
I will look into this.
Thanks for your comments!
This bug report was last modified 46 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.