I am running Emacs (26.1 - build 1, x86_64-w64-mingw32) on Windows 10 and I cannot type any key combination including CTRL and ALT_GR on my swedish keyboard.

I stumbled on this when I tried to use the C-M-\ (indent-region). But after some testing it seems the problem occurs with any combination including CTRL and ALT_GR. Alot of characters on the Swedish keyboard is mapped to ALT_GR combinations, e.g. to type $ I press ALT_GR-4 and for \ I press ALT_GR-+.

So in Emacs CTRL-h k gives this result:

  • CTRL-$ (CTRL-ALT_GR-4) => "$ runs the command self-insert-command..."
  • CTRL-META-$ (CTRL-ALT-ALT_GR-4) => "M-$ runs the command ispell-word..."
  • CTRL-\ (CTRL-ALT_GR-+) => "\ runs the command self-insert-command..."
  • CTRL-META-\ (CTRL-ALT-ALT_GR-+)"M-\ runs the command delete-horizontal-space..."

So it seems like the CTRL key is lost when ALT_GR is also pressed. How can I solve this?

  • Can you try temporarily switching to a layout without an alt gr key and test how Emacs behaves when you use the right alt key in combinations to rule out key jamming problems with your keyboard?
    – user12563
    Feb 3 '19 at 11:15
  • Changing to english layout doesn't seem to change the behaviour. Right-alt-a prints the character á, and CTRL-Right-alt-a also prints á.
    – j.karlsson
    Feb 3 '19 at 12:13
  • The answer to this question emacs.stackexchange.com/questions/3401/… says that emacs cannot recognize alt-gr. But I don't know if this is applicable to my problem.
    – j.karlsson
    Feb 3 '19 at 12:19
  • This is probably not an emacs problem. If I change to english keyboard layout and press the keys alt_gr-a and ctrl-alt_gr-a in notepad they both print á. So it's more likely some issue with the keyboard or keymapping on the Asus laptop I am using. Any suggestions on how I can fix this is appreciated.
    – j.karlsson
    Feb 3 '19 at 12:24
  • Same issue here with Emacs 27.1 on Windows 10 with a French keyboard. It works for me if: - press AltGr first and keep it pressed during the whole sequence - use CTRL key on the right side of the space bar C-} is obtained by: AltGr pressed during the whole sequence, rightCTRL-} C-M-@ is obtained by : AltGr pressed during the whole sequence, rightCTRL-M-@ C-M-\ is obtained by : AltGr pressed during the whole sequence, rightCTRL-M-\ Inspired by solution 1 of emacswiki.org/emacs/AltGrKey (I wanted to post it as a comment, but not enough reputation for that.)
    – Nicolas56
    May 2 at 10:37

Your Answer

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

Browse other questions tagged or ask your own question.