I'm doing some remote work using Azure & Bastion to access a customer site. The problem is that in this context, with Emacs, my right Ctrl key doesn't work normally.

What it's doing instead is adding a ESC into the sequence when I press it, for example when I press Ctrl+x I get C-M-x is undefined. The left Ctrl key works fine.

My local Emacs works fine. A keyboard logger on the remote machine doesn't show anything unusual. I've tried running a generic Emacs in case they had customized theirs. And I've tried running Azure in Edge and Chrome. No joy.

Anyone got any ideas?

2 Answers 2


You’re using some kind of remote desktop viewer in a web browser? It is probably a deliberate feature of the viewer. You’ll have to consult the documentation for that viewer, since this isn’t a problem with Emacs.


Solved by using Microsoft's Power Toys on the local machine. It has a keyboard mapper so I mapped my right ctrl key to my left one. The OS now thinks I have two left ctrl keys, but that works fine!

There are still actions which I can't trap (e.g. ctrl-w closing the window) as they are browser actions, but I installed a Chrome extension called "Disable keyboard shortcuts" to block them so I nothing happens if I forget and hit them by accident. Not perfect, but good enough to work with.

The problem is definitely with Azure Bastion, it's adding in the extra esc for the right ctrl but that's not documented anywhere I can find.

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.