(define-remapped-keys) With Multiple Key Sequences

2 views
Skip to first unread message

Brandon Hale

unread,
Dec 6, 2020, 5:23:57 PM12/6/20
to stumpw...@nongnu.org
Hello all,

I have just started playing with (define-remapped-keys) and was
wondering if there is a way to get multiple keys sequences in a program
to do one thing. Basically I want to do something like this:


(define-remapped-keys

    '(("(firefox|Chrome)"

     (("C-x" "C-h")   . "C-a"))))

I envision that me pressing C-x, then C-h, will allow firefox to do the
C-a key binding. Is there a way to do this and I just don't know the
syntax, or is this impossible?


Thank you very much for your help!,

Brandon Hale


Nathan Shostek

unread,
Dec 6, 2020, 6:59:35 PM12/6/20
to stumpw...@nongnu.org
Hi Brandon,

I dont belive that specific behaviour is implemented, but you can go the other way : ("C-k" . ("S-END" "C-c" "DEL"))

I think to get this behavior youll need to look at the function `remap-keys-event-handler`.

Im also interested in this and will take a look as well.

Cheers!

Ram Krishnan

unread,
Dec 6, 2020, 11:04:01 PM12/6/20
to Brandon Hale, stumpw...@nongnu.org
This isn't currently supported in the remap-keys feature. It shouldn't be too hard to implement, but does require something similar to the keymap handling behavior to be added. Unfortunately, I don't think the existing keymap handling could be directly applied as remap-keys is more of a translation of one key sequence to another - but, maybe there's a clever way to reuse the existing code.

Brandon Hale

unread,
Dec 7, 2020, 12:41:53 PM12/7/20
to stumpw...@nongnu.org
Thanks for the tip Nathan, I'll look into that function. If I find a way
to do it, I will make sure to share the code here! :)

Brandon Hale

unread,
Dec 7, 2020, 12:42:26 PM12/7/20
to Ram Krishnan, stumpw...@nongnu.org
Alright, I'll try to look into it and possibly find a way to do it.
Thanks for the help!
Reply all
Reply to author
Forward
0 new messages