2

I would like to be able to use CTRL and SUPER key modifiers together in a key binding. Since I'm on Mac OSX I use Command key for SUPER modifier.

I tried this:

(global-set-key (kbd "C-s-i") 'move-line-up)
(global-set-key (kbd "C-s-k") 'move-line-down)

but I get <C-s-268632073> is undefined message in the mini buffer when I press C-s-i combination.

Is there a way to use CTRL and SUPER key modifiers together in a key binding?

7
  • 1
    Works for me with 25.2.2 on Linux, at least to the extent that C-x @ s C-i runs move-line-up. What version of Emacs are you running? Do you get this message when you run global-set-key or when you press C-s-i? What happens when you press C-x @ s C-i ? Mar 14, 2020 at 20:46
  • @Fólkvangr tried it, but I get Invalid read syntax: "?" when I try to eval-buffer
    – Daut
    Mar 15, 2020 at 7:34
  • @Gilles'SO-stopbeingevil' I'm on GNU Emacs 26.3. I get message when I press C-s-i. I get C-x @ Tab is undefined in the mini buffer when i press C-x @ s C-i
    – Daut
    Mar 15, 2020 at 7:43
  • Did you press C-x @ s C-i, not C-x @ Tab? With a sequence beginning with C-x @ s, you should get a message about a translation. Mar 15, 2020 at 11:38
  • @Gilles'SO-stopbeingevil' OK this sequence works C-x @ s C-i but if I literally press s key, not super.
    – Daut
    Mar 15, 2020 at 15:12

2 Answers 2

1

Try this instead:

(global-set-key (kbd "s-C-i") 'move-line-up)
(global-set-key (kbd "s-C-k") 'move-line-down)

Dunno whether that works (I don't have a <super> key. The key description C-s means Control + s (character s, not super key).

Be aware, too, that C-i is the same as TAB.

1
  • 1
    I tried this, but unfortunately, it doesn't resolve the problem.
    – Daut
    Mar 13, 2020 at 20:54
1

I've just upgraded Emacs from version 26.3 to 27.1 and the keybinding works just fine now.

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.