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?

Drew
  • 75,699
  • 9
  • 109
  • 225
Daut
  • 31
  • 5
  • 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` ? – Gilles 'SO- stop being evil' Mar 14 '20 at 20:46
  • @Fólkvangr tried it, but I get `Invalid read syntax: "?"` when I try to `eval-buffer` – Daut Mar 15 '20 at 07: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 '20 at 07: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. – Gilles 'SO- stop being evil' Mar 15 '20 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 '20 at 15:12
  • @Gilles'SO-stopbeingevil' When I do that I get `s-TAB` message in the mini buffer when I press `C-x @ s C-i` and `C-s-k` when I press `C-x @ s C-k`. – Daut Mar 15 '20 at 15:52
  • @Fólkvangr OK, I tried this. When I use the `C-x C-e` key sequence I can see `backward-word` message in the mini buffer, but when I press `Super+Ctrl+i` sequence I still get ` is undefined` – Daut Mar 17 '20 at 16:50

2 Answers2

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.

Drew
  • 75,699
  • 9
  • 109
  • 225
1

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

Daut
  • 31
  • 5