7

I have a kinesis keyboard and would like to have the home key act as super in emacs without requiring me to remap my keyboard as well as edit my key bindings. Is there a simple way of doing this?

  • 1
    As far as I know, you cannot turn any arbitrary key into a modifier key in Emacs -- you would need to look at rebinding the key at the OS level. See related question emacs.stackexchange.com/questions/3272/…. – glucas Mar 1 '16 at 17:15
  • I think that's doable (kinda) through key-chord. @glucas – Gilles Mar 10 '16 at 12:45
  • Is your goal to use existing super- bindings? As @Gilles noted with key-chord you could re-define any super- bindings to achieve a similar effect. Although you could also just make home a prefix key with its own key map, if you don't really need it to behave like a true modifier. – glucas Mar 10 '16 at 15:00
7

The closest thing to a solution I know of is to do this:

(define-key key-translation-map (kbd "<home>") #'event-apply-super-modifier)

It's not quite the same as turning home into super though. Specifically, if you press home, release it, and then press e.g. a, Emacs will interpret it as s-a even though you released home before pressing a.

That's not necessarily a bad thing (in fact, it can have ergonomic benefits), but it may not be what you want (and it can be a bit weird to have this one modifier work that way, if you don't configure the others to behave the same).

Of course, there are event-apply-*-modifier functions for other modifiers as well. Modifiers that apply to keys after you've released them are sometimes referred to as "sticky modifiers".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.