bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#59130: Inconsistent behaviour with key-translation-map


From: Stefan Monnier
Subject: bug#59130: Inconsistent behaviour with key-translation-map
Date: Tue, 08 Nov 2022 16:41:59 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> However, setting
>> (define-key key-translation-map (kbd "<apps>") (kbd "C-x @ h"))
>> and pressing <apps> p will not execute H-p.
>> 
>> (C-x @ h adds prefix hyper
>> https://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html)
>> 
>> Is this an issue or as expected?

It's expected because the remapping of `C-x @ h` to a hyper prefix is
done with:

    (define-key function-key-map [?\C-x ?@ ?h] 'event-apply-hyper-modifier)

and `function-key-map` is applied *before* `key-translation-map` and hence
doesn't apply to the result of `key-translation-map` remapping.

    (define-key input-decode-map (kbd "<apps>") (kbd "C-x @ h"))

might work, OTOH, since `input-decode-map` applies before those
other two.

Note that `event-apply-hyper-modifier` has various limitations
(e.g. you can't use `?\C-x ?@ ?h ?\C-x ?@ ?m a` to make a `H-M-a` event)
so even if the above works it may not satisfy all your use cases.


        Stefan






reply via email to

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