IntelliJ has a keybind on a double-tap of Shift. I'm curious if Emacs can emulate this functionality - my first thought was key-chord.el, since it allows double taps of regular keys like qq. But, reading the key-chord.el documentation, it doesn't seem like it's possible to use modifiers keys as the keybind.

Any other packages that might be able to duplicate this functionality ?

  • Did you ever find a solution? Or did anything change? Nov 30, 2022 at 6:38
  • @JustinGodesky i didn't find a solution !
    – gempesaw
    Mar 15 at 21:33

2 Answers 2


Applications written with/for GUI frameworks such as X11 can generally receive individual key-up/key-down events, so it would be possible if only Emacs exposed that functionality to the land of Elisp, but it doesn't.

For a surprise though, in e.g. an X11 frame, hit C-h k, then click down with your mouse, drag it around, and release it somewhere. The up/down functionality is there for mouse buttons already, and even dragging is considered a key. Scrolling the mouse wheel likewise; it even generates double- and triple- events.

Anyway, for modkeys, we're sadly out of luck until someone patches the C code. What you might also try is mess with your X keymap; possibly a key can be made a modkey and a normal key simultaneously, but I don't know.


See https://stackoverflow.com/questions/26500567/can-i-bind-something-to-alt-meta

I admit to being surprised that IntelliJ can do that, as I was under the impression that all applications would be in the same boat when it came to receiving input from modifier keys alone.

If someone can provide some details, I'd be interested. My initial guess is that it's related to terminal limitations? (in which case GUI Emacs might in theory be able to do likewise, but possibly not without breaking terminal compatibility?)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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